0

I currently run a wp/woocommerce site that's been optimized as far as I can take it for an Apache server:

MySQL memory optimized WP Rocket MaxCDN

VPS: 2 cores 2 gigs of ram SSL

The site offers about 50 different services while it updates & cycles through orders every hour. It's a WP/WC site so it has a small blog and account area for customers. There will also have some free web based tools available soon.

My biggest bottleneck is probably PHP and around 70 requests to the server on page load.

From what I've been reading Litespeed is still faster, but I'm not sure if I'll see much of an improvement if my apache server is already optimized, especially if I change to fastcgi. Also, it's not very clear to me what some of the limitations may be. The last thing I want is to change web servers to find parts of my site stopped functioning.

Do I need to worry about my PHP scripts not working with LiteSpeed, or can Litespeed handle everything you could throw at an apache server?

7
  • If PHP is your bottleneck, changing the web server won't help that much. Focus on finding out what your bottleneck actually is, and then you will know where to spend your time. Mar 13, 2017 at 20:17
  • You need to work out what the problem is, but typically PHP uses a lot of CPU. Make sure images are served by your web server not PHP. Typical solutions include caching and making more CPU available. Changing web servers is not typically going to help this type of problem.
    – Tim
    Mar 13, 2017 at 20:49
  • @tim Thanks for your input. I'm considering making a couple server upgrades, (4 cores, 4 gigs of ram, & SSD). Also considering nginx reverse proxy with apache and using fastcgi on top of that if it's possible. I'm not a network engineer, but I have a managed plan so my webhost will configure all this. It's just a matter of knowing what I want them to do.
    – nickyb
    Mar 13, 2017 at 21:01
  • No point putting a reverse proxy in, given what you've told us. You need to do more analysis and really consider caching. If you can cache a page that's not authenticated, so you don't have to hit PHP, you might not need to buy a bigger server and you may speed the website up.
    – Tim
    Mar 13, 2017 at 21:12
  • @tim What kind of analysis or tests do you suggest performing to figure this out? Aside from using a good caching script, CDN, and optimizing the server's memory for mysql (which I have done) I'm not sure where else to look. All these suggestions are greatly appreciated by the way.
    – nickyb
    Mar 13, 2017 at 21:20

2 Answers 2

0

Litespeed has an ESI which supports section cache. Also it's wordpress cache plugin has a particular custom thirdparty support for woocommerce.

Just give it a shot:

https://wordpress.org/plugins/litespeed-cache/

Theoretically, partly cache for your site should at least help you speed up those 70 requests per page load. Server level cache should make wordpress faster than php level cache. That is why it is faster than super cache I think:

https://ops.kickassd.com/wp-super-cache-vs-litespeed-wordpress-cache/

@Tim

The reason I recommend Litespeed for this situation is Litespeed can cache block and serve different content even using same URL. Have a look at https://nyphper.wordpress.com/2017/02/23/how-to-use-litespeed-vary-to-generate-different-caches-for-one-page-url-php/

This is a easy test to understand this smart way:)

8
  • Nginx and Apache can both cache pages relatively easily.
    – Tim
    Mar 13, 2017 at 22:21
  • @Tim If they can support block cache, it should be ok too.
    – Highlight
    Mar 15, 2017 at 16:29
  • 1
    I use Nginx as a page cache. If an anonymous user wants a page PHP isn't invoked, saving a lot of CPU time and actual time. For logged in users you need plugins or other forms of caching.
    – Tim
    Mar 15, 2017 at 17:56
  • @Tim Can you server different cache for one link based on cookie? e.g. an anonymous user may choose two kinds of listing style: grid or list. Or choose different sort by.
    – Highlight
    Mar 15, 2017 at 19:58
  • I believe page cache is purely by URL. If the url has a sort parameter the results will be cached correctly. If it uses another technology it's possible the page cache won't work. You can exclude users with cookies from caching, but I don't think you can change what's returned based on it - typically page cache isn't useful for logged in users. Many websites are "read mostly", so caching only anonymous reads can significantly reduce load.
    – Tim
    Mar 15, 2017 at 20:03
0

Changing between Apache vs. Litespeed vs. OpenLitespeed will not have much affect on immediate performance, as the bigger concern is optimizing your configuration (settings) rather than just swapping servers.

That said, if you are running a high-traffic WooCommerce site than there might be a lot of uncached dynamic queries (esp. on your checkout and cart pages) going on meaning your database performance and RAM are important here, try:

MySQL + object cache (e.g. Redis) + plenty of RAM memory for Redis to use (seriously high traffic sites might consider a dedicated/managed remote database server)

Besides that, stop using janky WordPress cache plugins like WP Super Cache or WP Rocket and use actual server-level caching instead, like the pros do. Those plugins are fine on low-traffic sites that want an easy way to manage caching, but not for high-traffic.

This is why Nginx is so easy for standalone high-traffic sites like this, because you simply setup a LEMP stack server using open source software and FastCGI Cache is included in Nginx already. Free scripts like my own project SlickStack can do the entire setup for you in less than a few minutes (there are several others too, like EasyEngine, Webinoly, WordOps, CentminMod, and more).

Of course, Litespeed has server-level caching too called LSCACHE and Apache has multiple cache features as well, but there are no easy installation scripts for these that I'm aware of meaning that you will need to know exactly how to configure the OS, server, caches, etc, or you will simply need to continue using shared hosting companies that do all that configuration for you (e.g. cPanel).

TLDR both Litespeed and Apache are a better fit for shared hosting companies using e.g. cPanel than for standalone sites looking for cleaner config and faster speed/security. So if you really want to stay using Apache or Litespeed why not just keep using your shared hosting company instead, and ask to upgrade to a better plan or whatever.

As far as "reading that Litespeed is faster" see my answer here, where I briefly warn users that Litespeed has been posting propaganda: https://webmasters.stackexchange.com/a/137195/104668

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .