I'm currently using Laravel for a project I'm working on, and my web-server has recently started performing very slowly upon page load, whereby each page can take up to eight seconds until loaded.
Thus far, I've determined that the slowness is not caused by the following:
- DNS issue; issue occurs when I navigate directly to the server's IP
- Apache issue; a blank PHP file with 'phpinfo()' loads instantly without any delay
- Load; Server's CPU usage is never above 20%
Following the above steps, the issues only occur on the live environment, where my development environment shows no signs of delay.
After analysing some cachegrind logs, I found that the PDOStatement->execute call appears to take up the largest amount of delay.
I then enabled long_query_time logging in MySQL to further determine the issue. My findings show that most of my queries are being executed quickly, well under one second; however, I've found that any site_session queries executed are taking up to six seconds to be executed.
As a further troubleshooting step, I attempted to temporarily change my sessions drive to file instead of database; however, I'm finding that the following queries are still being executed after each page load:
# Time: 150813 23:37:12
# User@Host: root[root] @ localhost [127.0.0.1]
# Query_time: 3.035622 Lock_time: 0.000022 Rows_sent: 0 Rows_examined: 1
SET timestamp=1439509032;
update `site_sessions` set `payload` = 'YTo1OntzOjY6Il90b2tlbiI7czo0MDoibHk0YVo2MG16c09acTBTSnVnYUlJVTFNM0VrU3B2ekdiRFJyYmRzWiI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6MjY6Imh0dHA6Ly93d3cuY29ycGxlYWd1ZXMuY29tIjt9czo1OiJmbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX1zOjM4OiJsb2dpbl84MmU1ZDJjNTZiZGQwODExMzE4ZjBjZjA3OGI3OGJmYyI7czoxOiIxIjtzOjk6Il9zZjJfbWV0YSI7YTozOntzOjE6InUiO2k6MTQzOTUwOTAyODtzOjE6ImMiO2k6MTQzOTQ5Nzc5MjtzOjE6ImwiO3M6MToiMCI7fX0=', `last_activity` = '1439509029' where `id` = 'ba62f70745c5455611c3fe3bf008fa213c22a7f9';
# Time: 150813 23:37:27
# User@Host: root[root] @ localhost [127.0.0.1]
# Query_time: 1.071487 Lock_time: 0.000026 Rows_sent: 0 Rows_examined: 1
SET timestamp=1439509047;
update `site_sessions` set `payload` = 'YTo1OntzOjY6Il90b2tlbiI7czo0MDoiOGhiVVVobTFjTERrU1ZXR25weTdMWHlQRlMzTmtkOWhIZzFSdHQ1QSI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6MjY6Imh0dHA6Ly93d3cuY29ycGxlYWd1ZXMuY29tIjt9czo1OiJmbGFzaCI7YToyOntzOjM6Im9sZCI7YTowOnt9czozOiJuZXciO2E6MDp7fX1zOjM4OiJsb2dpbl84MmU1ZDJjNTZiZGQwODExMzE4ZjBjZjA3OGI3OGJmYyI7czoxOiIxIjtzOjk6Il9zZjJfbWV0YSI7YTozOntzOjE6InUiO2k6MTQzOTUwOTA0NjtzOjE6ImMiO2k6MTQzOTUwNDQzODtzOjE6ImwiO3M6MToiMCI7fX0=', `last_activity` = '1439509046' where `id` = 'c3e95cf7c317ad340aa28c61bf323e008eaa5ff0';
Can anyone shed some light on this issue, or equally, provide additional troubleshooting steps that will help me determine the root cause?
Any feedback is greatly appreciated!
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire