New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Vps for two sites with intensive mysql use
I have two sites using mysql enough, now I have them on a vps with cpanel installed (with varnish cache) in VPSDIME.
The databases are on the external mysql server that offers vpsdime.
Even so the vps was restarted yesterday for CPU usage (load of 2 for more than two hours)
Can you recommend some service to host these sites? Ideally it with cpanel.
Comments
Abusivecores or go with a dedicated server.
How many queries per second are you doing? Is there any room for optimization?
Might want to consider a dedicated server (with SSDs) as I can't imagine too many VPS providers will be keen on the high disk IO/CPU usage. Post your budget and see what offers you get.
As I can get that information?
My ideal budget is US20 monthly
Try https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl
works if the databases are on an external server?
Yes - it's just connecting and running SQL queries.
See that long list of recommendations? Start there
Then you can either look at better caching or moving server.
If I understand correctly OP is using an offshore mysql server that is not under his control.
@OP:
If you have lots of request/sec, do consider a higher budget and get something better. I have a website with 2M PV/day, 200 req/sec on peak hours and that's way beyond low end area. Think twice if you are under similar load.
short url :
Your VPS's load is not related to mysql queries since they are running on an offloaded server. The thing that makes high load is CPU usage on your VPS. You need to use a caching plugin like varnish to reduce the load.
Edit: Ops, didn't notice that you already use varnish. Varnish's ram usage allowance may need tweaks.
Optimise your caches or it may be time to upgrade...
If you are using a high ram VPS and your db is not huge, you may gain a lot by loading mysql to ram. There are a few ways, from caching, to a ramdisk you periodically sync, I would suggest the first option since it is easier to tune and less dangerous for newbies. Just run free -m and if you have a lot of free mem, start loading things to ram!
http://www.mysqlperformanceblog.com/2011/04/04/mysql-caching-methods-and-tips/
You may also look at indexes, bad indexing can cause a lot of cpu usage.
Nice link @Maounique - this one is a bit older...in fact so old I wonder if it's still relevant, though the params haven't changed.
http://www.mysqlperformanceblog.com/2006/09/29/what-to-tune-in-mysql-server-after-installation/
Do a MySQL load balancing with percona xtradb cluster
I just installed litespeed + varnish. low CPU load immediately, I hope to continue like this.
The effect should be mostly from varnish.
My first setup was: Apache + varnish and had problems with the cpu load
Changing the settings to: litespeed + varnish the improvement was quite
Note: in both cases use the varnish plugin of unixy.net
Then Apache was not configured correctly, in general, the cpu gain from apache to litespeed is minimal, I would say at most 20%, probably 10 or below. That is, if they are both tuned tot he max for the app at hand.
Not an expert in php tuning, but generally php-fpm yield better performance compared to mod_php.