Discussions

Site performance suggestion, please!

We're using Drupal 7 with commerce kickstart 2.10 - we're using dedicated server for our hosting, but the site's very slow compare to the hosting package - https://mukano.com
It'll be good if we can achieve the speed demonstrated here: http://demo.commerceguys.com/ck

I've optimized PHP & MySql but no significant changes, my.cnf file has the following config:
[mysqld]
max_connections = 300
key_buffer = 256M
myisam_sort_buffer_size = 32M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 4000
thread_cache_size = 296
interactive_timeout = 25
wait_timeout = 7000
connect_timeout = 10
max_allowed_packet = 100M
max_connect_errors = 10
query_cache_limit = 32M
query_cache_size = 64M
query_cache_type = 1
tmp_table_size = 32M
[mysqld_safe]
open_files_limit = 65535
[mysqldump]
max_allowed_packet = 32M
[myisamchk]
key_buffer = 32M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M
[mysqlhotcopy]
interactive-timeout
log-slow-queries=/var/lib/mysql/slow.log

I'm I missing something? Any suggestions 'll be appreciated, thanks.

Posted: Dec 9, 2013

Comments

wildchief on January 3, 2014

I use a VPS (digital ocean) for my commerceKS. I was worried about all the modules making a really slow site. I also replaced apache with nginx and with all the drupal performance turned on the site is pretty speedy. I understand this is not related to your php.ini but i took a different approach altogether

Philben on December 10, 2013

Thank wildchief. Can you please explain further how you implemented you approach? It'll help if post url to your site too.

wildchief on December 11, 2013

Hello

Here we go (I will write an article on how i did all of this at some point to remind me of what i did)

My site www.zaphira.co.uk is a small site which i anticpate, based on other sites in the same niche i have created, will have a maximum of 500 uniques a day so is pretty tiny in the scheme of things. If your site is going to be bigger than this kind of thing then my ideas might not work for you

Hosting
=====
I needed to find a host that fitted the following criteria:

Fast
Affordable
Located near to my users (Previously I have found that location effects search engine listings)

Normally I use linode as they have a DC in London and my users are all UK. However I found another host "digital ocean" which have a DC in Amsterdam. I got myself 1gb vps from Digital ocean for $10PCM . So far I have started appearing in the page 2 - 3 for my target key words on google.co.uk. So looks like Amsterdam DC won't be a problem for my UK users -so far.

Server Operating System
==================
I chose Centos as it is basically redhat and I know that quite well - although I am sure Unbuntu would do if you know that better

Web Server
========
NGINX This was the real leap of faith! I have used apache for years and have never thought about switching until I looked at tools like this

http://tools.pingdom.com/fpt/
http://developers.google.com/speed/pagespeed/insights/

I realised I had a lot of work to get my site speedy - and I had heard nginx can be a big improvement for speed

I was worried that installing nginx was going to cause me troubles with config etc. However so far it has been straight forward.

So if you want to give it a try i can answer questions

stuff like this was very helpful http://wiki.nginx.org/Drupal

MYSQL
======
I haven't done much about this yet. Although I will look at tuning it up. I haven't looked deeply at alternatives either so i don't know how much more speed i can squeeze out or if i need to.

MODULES AND STUFF
=================
I haven't looked at other performance modules yet e.g boost
I do have APC installed but that was almost a fire and forget install and really makes a difference

jsamuel on December 17, 2013

Hi wildchief. We've had quite a few developers set up their server's software stack using ServerPilot and get good performance improvements. It might be worth a try next time you spin up either a DigitalOcean or Linode server.

ServerPilot is a hosting control panel that was designed for developers managing their own servers. It requires Ubuntu instead of CentOS, but it sounds like you'd be open to that.

Sagar J on December 31, 2015

Hi,

We are working on 3 year old Drupal commerce website - shop.kayaclinic.com

Its database is pretty huge. around 14GB. We removed orders older than 1 year and created archive for older orders. This way we were able to reduce database to 7GB. Website load time is reduced by half. But Drupal commerce is using views module for rendering cart. It has serious performance issues.

We tried all possible solutions but failed to optimize the website and MySQL is going down every alternate day.

Can you please let me know what all things should I consider while optimizing the website.

Philben on December 16, 2013

No, I tried installing memcache on my server but had configuration issues.

DNZ Andy @ BlueFusion on December 18, 2013

Your site seems to be down at the moment, but I had a look the other day - great overall look and nice left hand nav :)

Are you sure the problem is on the server end?

  1. Move the JS to the foot of the page and not the head.
  2. Install mod_pagespeed and see https://developers.google.com/speed/pagespeed/module/https_support
  3. You have a lot of images loading into the 'Latest deals' slider on the homepage. If you can reduce the number or lazy load them that will help a great deal.
  4. Combine the CSS as much as you can without destroying your work flow.

I would start with those, probably in that order as that's the easiest & quickest to implement. I suspect that #3 is the currently the biggest performance killer though.

Philben on December 18, 2013

Thanks for your helpful suggestions, DesDNZ.
Yes, the site was down for a while, but it's running now; you may need to clear your browser cache tho.

interdruper on December 22, 2013

At least for anonymous pages. Varnish, memcache, APC, Boost (in shared hosting environments)... any of the them will vastly improve your sites response time.

The old rule of thumb in reducing the size of your pages always applies. Drupal is particularly verbose rendering HTML, and few things can be done related to this, but you can easily reduce the size of your images using some optimization pre-processing. One of my favorites options is TinyPNG.com API, that can reduce more than 50% the current size of your png images. A recent patch for ImageAPI Optimize module adds this optimization service to the native Drupal image styles generation process, see https://drupal.org/node/2160945

Of course, any other optimization will also help, like mySQL and Apache fine tuning.

You can try also New Relic tool for discovering in which hooks and queries your response time is going away.

Philben on January 2, 2014

Thanks interdruper. I've installed Nginx and I can see a difference. I'll also try adding memcache and TinyPNG - thanks for your helpful suggestions.