2

I have Magento 1.9.3.6 running on PHP 5.6 (not sure if that is important). My website is running very slow and when I asked the host company if they could investigate, they said it was session queries that were causing the problem.

Can someone help me with this? I'm not a database person and I'm trying to figure out what is causing this.

Thank you... Vicky

The exact message as follow:

==========

1225 xgfmzkpgk      localhost xgfmzkpgks        300  Query updating DELETE FROM `mgik_core_session` WHERE (session_expires < 1521477610) 
    1337 xgfmzkpgk      localhost xgfmzkpgks        198  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1374 xgfmzkpgk      localhost xgfmzkpgks        182  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1396 xgfmzkpgk      localhost xgfmzkpgks        160  Query updating UPDATE `mgik_core_session` SET `session_expires` = '1521481350', `ses
    1399 xgfmzkpgk      localhost xgfmzkpgks        156  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1400 xgfmzkpgk      localhost xgfmzkpgks        145  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1405 xgfmzkpgk      localhost xgfmzkpgks        144  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1406 xgfmzkpgk      localhost xgfmzkpgks        142  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1410 xgfmzkpgk      localhost xgfmzkpgks        132  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1417 xgfmzkpgk      localhost xgfmzkpgks        121  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1421 xgfmzkpgk      localhost xgfmzkpgks        111  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1422 xgfmzkpgk      localhost xgfmzkpgks        111  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1428 xgfmzkpgk      localhost xgfmzkpgks        94  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1429 xgfmzkpgk      localhost xgfmzkpgks        90  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
    1430 xgfmzkpgk      localhost xgfmzkpgks        87  Query  update INSERT INTO `mgik_core_session` (`session_expires`, `session_data`, `
      982      root      localhost xgfmzkpgks        80  Query System l CHECK TABLE `mgik_log_visitor`  
1

Is your website high traffic? Typically, default my.cnf (MySQL Config) will run slow with Magento (in my experience). Do you have access to my.cnf or are you on shared hosting?

Also I've seen instances where the session storage table became huge due to garbage collection not taking place on the SQL server. Check your core_session table in mysql. If its > 500MB then that's going to slow it down.

You can try changing session storage to files, in app/etc/local.xml change the session_save as below. Clear caches in Magento.

<session_save><![CDATA[files]]></session_save>

Please note, all carts will clear when you do this, as its moving the session storage which will essentially clear it.

  • Thanks Rick, That helped a lot. I also upgraded my servers ram and it seems to run better. Hopefully these combinations will help in the long run – user32527 Apr 11 '18 at 13:35
  • No problem @user32527 , check out magento.stackexchange.com/a/406/12148 for info on garbage collection also, otherwise you'll end up with GB's worth of session files, which will cause slow / large backups. – Ricky Odin Matthews Apr 12 '18 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.