Support the ongoing development of Laravel.io →
posted 10 years ago
Configuration
Last updated 2 years ago.
0

Laravel loads a lot of files. This can be optimized by running php artisan optimize, which puts a lot of classes in 1 file. It depends on your server, if you have a slow disk IO, Laravel won't be super fast in my experience. But this should be helped with APC/OpCache.

You can try my debugbar (https://github.com/barryvdh/laravel-debugbar) to see if you do any weird queries. You can also add some timing and show all the included files.

Last updated 2 years ago.
0

Thanks for your quick response, barryvdh! After writing this question, I did a "artisan optimize --force" which helped a bit. Response time (in Chrome Dev Tools) is now around 180-320ms for pages with DB queries. Peak CPU load is now between 12 and 16%. I'm using your package for local development. On the timeline tab I see that the DB really isn't the bottleneck (queries usally take 2-9ms), but Booting takes around 50-100ms and Application takes around 250-500ms depending on the page I'm requesting.

I have to add that I am not using any framework level caching at all at the moment. I'm planning to use memcached in the future for expensive pages.

Is there a way to test disk IO speed?

Last updated 2 years ago.
0

Not sure, but are you running in Vagrant? Or you production server? Because VM's and local servers are probably slower then you production server. The booting isn't something you can easily fix, except you can add more classes (serviceproviders etc) to the config/compiled.php so they are also optimized. You can enable the files collector in my debugbar config, so you can see which are used.

Caching stuff does also work of course. If you have a static site you can look at Varnish or some full page caching like this: https://github.com/barryvdh/laravel-httpcache

Last updated 2 years ago.
0

I first noticed this on my Homestead Vagrant box and then deployed the project to my production server to check if there are the same issues.

I'll try to add more files to config/compile.php to see if this has any effects, thanks for the heads up!

I'll definitely take a look at your httpcache package!

Thanks!

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

gpluess gpluess Joined 6 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.