3

I have migrated the existing application from core php to laravel framework. But the laravel application usage more than 90% cpu for the 100 concurrent users but the same application developed in core php usages the 5% cpu load only for the same load.

Then I have created one sample 'helloworld' application in laravel for load testing and result is the same. I have tested the laravel application using load testing tool siege, hits url 'siege www.mysite.com/helloworld -c250 -t20s' for 250 concurrent users (duration 20 sec) and still cpu load reaches more than 90% (linux centos 7.5 8 core 8 gb ram apache).

Also tested the core php file 'helloworld.php' using same load testing tool ('siege www.mysite.com/helloworld.php -c250 -t20s') but CPU usage not exceeded even 5%.

  • I am using the latest php version ie 7.2
  • linux server centos 7.5 8 core 8 gb ram
  • apache
  • Also tried the varnish http cache
  • laravel version 5.4 (also tried the 5.6 but the result is the same)

I don't know where is the issue I have tried everything but still not resolved the issue. Is there anything missing in the configuration on the server or in the coding end. Please suggest.

CP Soni
  • 423
  • 4
  • 13
  • are you using php opcache? – Jasmin Mistry Aug 10 '18 at 07:10
  • Yes, its enable too. – CP Soni Aug 10 '18 at 07:13
  • Core php app/url works extremely fast with minimum cpu usage as compare to laravel. The main issue is cpu usage. – CP Soni Aug 10 '18 at 07:16
  • Then you need to debug code using profiler to find problem otherwise its difficult to solve it. – Jasmin Mistry Aug 10 '18 at 07:17
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Server Fault](http://serverfault.com/) or [Webmaster Stack Exchange](http://webmasters.stackexchange.com/) would be a better place to ask. – jww Aug 10 '18 at 07:20
  • @JasminMistry, I have check the simple hello world application no extra code but still the same issue in the case of concurrent users – CP Soni Aug 10 '18 at 07:25
  • check this https://stackoverflow.com/questions/16897997/laravel-artisan-queues-high-cpu-usage/25499624#25499624 – Bilal Ahmed Aug 10 '18 at 07:58
  • @BilalAhmed, I haven't set up any queues. So this is not the case. – CP Soni Aug 10 '18 at 08:03

0 Answers0