Don't use shared hosting on some crappy server that's overloaded with customers. You can get a nice VPS/Cloud server for cheap nowadays. Although good shared hosting with SSH access can be worth it.
laravel on shared hosting
Hi,
i have been developing a laravel app on my localhost, but after i deployed it to my shared hosting the speed dramatically slowed.
On my localhost, i had a waiting time around 100ms and on the shared hosting i have got WT between 1-4 seconds, which is really annoying.
I think, the problem has to be with the database - because, sites where i call for db take much longer to load.
I performed php artisan optimize, php artisan autoload-dump and also turned off debug mode. It did not help pretty much - is there a way or some things that should i do to improve the performance?
The problem must be connected with the database... however, is it really worth it to buy a VPS?
There's so many things that would slow it down on shared hosting (the setup is different).
I believe it is. I even run my sites on my own fully dedicated servers
Thanks for help - and is it possible to run more laravel projects on one VPS? (in term of performance)
You can run as my projects as you want on a VPS, the more sites you add thought and the more traffic they generate the slower things will be. With a VPS you can add more ram or cpu any time if things get slow, or you can move your databases to another VPS easily.
I am on a deticated server and have like 150 sites running on it a performing well. Average site thought gets around 1K visitors per month, only 5-6 sites are busy with around 50K visitors.
The above is correct. Since you have full control over the specs of the server being hosted and how many sites you run on it is up to you. Good luck :)
Laravel Forge will help you setup a VPS and run multiple apps on it.
Other that security patches, it won't help much with maintenance or if things go a little pear shaped, so don't forget the PaaS option if your not so inclined to maintain a server. Slower and more expensive ... But if time is short it can provide value.
I had that too until I ran php artisan optimize before deploying it.. that seemed to speed it up drastically.
http://laravel-recipes.com/recipes/60/optimizing-the-framework-for-better-performance
@yaniksilver Don't confuse shared with limited web hosting.
the performance you get on dedicated SSD server can never be achieved on a shared server.
Also don't put shit in people's heads. Shared doesn't mean less performance...
Agree with @bashy, the good shared hosting are faster than poorly managed vps.
@psmail Are you sure about that? I use Laravel forge, but I haven't seen an option to add another site to the same VPS.
@IsaacBen when you view your server on Forge, there's a big form at the top titled Add Site - you can't miss it :)
I was using a shared hosting with Laravel several months ago.
It was such a headache to apply all modifications made to the application: I had to upload (update) each modified file with an FTP client.
Now I am using Digital Ocean and am very comfortable with it. I purchased the cheapest plan (it is enough for me, right now) and won't ever come back to a shared hosting again.
I really recommend you to switch to a Cloud VPS.
@atorscho Yeah a shared hosting without SSH access is stupid :) I'd of moved from there ages ago.
@bashy Do you use CPANEL with your server? Or is everything through the command-line?
@IsaacBen I don't use cPanel or any control panel. I'm on dedicated servers setup manually.
Shared hosting isn't all bad. If the server isn't overloaded and you have full ssh access to your account Laravel can be fast.
If it isn't fast or if you don't have command line access (sometimes you might have to ask your host for this) then you should probably look for another webhost.
You can get some quite cheap unmanaged VPS's, almost the same price as shared webhosting but then you would need to manage it and setup backups etc. If you want to learn some sysadmin skills than that could be good, but if you're worried about security and don't have any sysadmin skills than a good quality shared hosting plan might be better.
My take on this would be that as long as you are using a shared hosting package from a good company like Hostinger for example, you will be able to milk it for what it's worth. A problem that you may run into is if you are using a very large amount of records for your system on a daily basis which you can curb using caching best practices implemented by stuff like Redis.
@KingStevenNOS dude, its a 7 year old question. You win todays prize
Please or to participate in this conversation.