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?

Jesse Nickles
  • 250
  • 1
  • 12
nickyb
  • 1
  • 3
  • 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. – Michael Hampton Mar 13 '17 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 '17 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 '17 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 '17 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 '17 at 21:20
  • Start with top / atop during a peak to work out what resources are in short supply. "Caching script" doesn't really make sense, you need to work out what can be cached without compromising security / privacy, it will be done in your web server configuration. You could get a consultant to help with this - some of the people who answer questions here do consulting, you can work out who by clicking their names. – Tim Mar 13 '17 at 21:35
  • our php codes work fine after immigrated to litespeed. we have bunch of php extensions. We were Apache before. Litespeed is at least easier to config(webadmin is awesome). – harrrrrrry Mar 14 '17 at 00:21

2 Answers2

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

Jesse Nickles
  • 250
  • 1
  • 12
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:)

Highlight
  • 9
  • 2
  • Nginx and Apache can both cache pages relatively easily. – Tim Mar 13 '17 at 22:21
  • @Tim If they can support block cache, it should be ok too. – Highlight Mar 15 '17 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 '17 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 '17 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 '17 at 20:03
  • @Tim that is why I suggested him try Litespeed cache. It can serve different content even with same URL. Especially for online shopping I think it can be faster. – Highlight Mar 15 '17 at 20:25
  • Great :) Have to be careful, if the user is logged in you can't cache pages at all. Blocks, maybe. – Tim Mar 15 '17 at 20:28
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/55448/discussion-between-highlight-and-tim). – Highlight Mar 15 '17 at 20:53