slow VPS site
I have a VPS site running Virtuzzo with Blacknight. Unlike Alan who also had VPS problems with Blacknight and on a similar spec-ed machine, the server isn't grinding to a halt and the server load rarely goes above 2 or 3. The site is going live this week but the performance is very poor, and no matter what I try I can't seem to improve things much.
First thing I did was to remove all the unnecessary services installed (i.e. the mailserver, spamd) which saw an immediate improvement in the performance of the site. APC is installed, as is Memcache (5 daemons) which is configured with the cache router module. And for good measure I have Boost enabled too. Using APC's reporting tools, I can see I'm getting a 90% (or higher) hit rate on its cache. I can't entirely make sense of the memcache reports however.
I ran benchmarks on the site using ab (ab -c4 -n100). Before installing memcache and boost, I was getting 10 requests per second served (up from 2 with no caching at all). With memcache enabled this went up to 16, and with boost too, this is now 18 for anonymous users. There were improvements each time, but fairly slight.
From looking at the breakdown of the percentages ab gives, the site takes on average 29 seconds to serve 2% of the requests, with the rest all being 1 second or less. I'm presuming that the major decrease is due to caching, but I can't figure out why there is such a high delay for that 2%.
This is more noticeable as a logged in user however, where I reckon at least 30% of the requests take upwards of 15 seconds. Since this site isn't just for anonymous users, it's something I can't very well ignore. Using the devel module I logged the query time. For my test page, a panel page containing about 10 blocks (created via 'add block') and no views and not much else, it has an execution time of 5463ms, with 94 queries taking 1187ms. A good 20 to 30 of the queries are taking between 11ms and 60ms to complete. This makes me think that mysql, or perhaps a rogue module, are to blame.
For example, drupal_lookup_path() took 53ms to do the query: SELECT src FROM url_alias WHERE dst = 'home' AND language IN('en', '') ORDER BY language DESC, pid DESC That's exceptionally high IMO. The same query run at the mysql prompt takes just 0.019ms to run.
I'm really at a loss at where to go from here. I'm thinking mysql might be to blame, but the tuning-primer.sh script turns up nothing of interest, and it is fine at the mysql prompt. My only other thought is that it might be a rogue module, but what? I've disabled all modules not in use, leaving 140 enabled.
Any thoughts, ideas or advice?


Do you have MySQL cache
Do you have MySQL cache enabled? If yes, most of the SELECT FROM url_alias should take less than 1 ms, usually 0 ms. 53ms is considered long only when the disk is idle ;) It's not always the case.
Do you use complex layouts, Views, Panels? If yes, sure your site must be slow. In each views, check the query execution time and enable cache (5 mins cached may help).
You are correct to blame MySQL ;) Just make sure to blame the right queries. To check the execution time (and bypass MySQL cache so that the time is correct), add some spaces to have a different query so that the cache is missed.
Yep, mysql caching is
Yep, mysql caching is enabled. The query itself is very quick when run at the mysql prompt, but when run from within Drupal it's ridiculously slow - and this when there is no traffic on the server, just me! I can see from the mysql logs / show processlist that there are no other long mysql queries running at the same time.
Yes, we're using views and panels (with caching!), but again, this happens on every page, even basic admin pages like admin/settings/performance and there's no one else using the site at present.
I think it's a more general problem than any one particular query, cos even admin/settings/performance can take 30 seconds to load.
vzfs filesystem
The consistently long query times makes me wonder if you are using vzfs, the file system for Virtuozzo. I have seen that to be a bottleneck on many sites using Virtuozzo. Xen does not have this bottleneck.
Drupal performance tuning, development, customization and consulting: 2bits.com, Inc..
Personal blog: Baheyeldin.com.
We went live on my crappy dev server
We went live on my crappy 3 year old, single core, 1GB RAM, development server, and it's substantially faster than the 16-core VPS one, not great, but at least usable, as long as the load isn't too heavy.
Yep, the VPS is using Virtuozzo, and has vzfs file system. However we've made the decision to just ditch it and go with a dedicated server and be done with this. We also found out that each of the 16 CPUs were throttled at 30MHz, which I think is appalling.
We're looking into dedicated servers in Ireland, UK and mainland Europe. We don't really want to get a server in the US/Canada as most of our traffic is in Ireland. Recommendations, advice or even suggestions for server specs more than welcome.
My recommendation is to get a
My recommendation is to get a well speced VPS from Slicehost.
The pingtime is hardly noticeable.
Failing that, Digiweb hosting [aka Host.ie]
myhost.ie
Hi Stella,
maybe have a chat with Martin in Myhost.ie to see if they have something that meets your requirements.
http://www.myhost.ie/
061 749922
They're the sponsors of DrupalCamp Ballyvaughan 2010 and we use a VPS from them for our Drupal sites. They've responded quickly to any issues we've encountered.
Hope you get sorted,
Conor
DrupalCamp Ballyvaughan (Ireland) 15th & 16th of May 2010
http://www.drupalwest.com
Hi Stella, The advice from BK
Hi Stella,
The advice from BK is sometime your better off servering the pages from your VPS but use a shared MySQL as it has more resources available. My experience is that although administering Drupal can be slow, generally speaking the public and restricted pages run fine.
But...for the price of a BK VPS, take a look what Hetzner offer in the world of managed servers.
David
very new to this world
Sorry, should have updated
Sorry, should have updated this post. We gave up on Blacknight and eventually deployed to a managed server with Hetzner. Everything is now working smoothly. I'm never planning on using a BK VPS again.