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.