6. Streamlining the Checkout Process · 2019. 10. 28. · caching, PHP7, the latest version of...

14

Transcript of 6. Streamlining the Checkout Process · 2019. 10. 28. · caching, PHP7, the latest version of...

Page 1: 6. Streamlining the Checkout Process · 2019. 10. 28. · caching, PHP7, the latest version of MySQL and a host of other server tweaks out of the box, this r oute was much quicker

 

 

 

Page 2: 6. Streamlining the Checkout Process · 2019. 10. 28. · caching, PHP7, the latest version of MySQL and a host of other server tweaks out of the box, this r oute was much quicker

Table of Content 

1. About Nutrabay 

2. Services Delivered 

3. The Project 

4. Setting up Caching 

5. Codebase Optimization 

6. Streamlining the Checkout Process 

7. Result 

 

 

 

Page 3: 6. Streamlining the Checkout Process · 2019. 10. 28. · caching, PHP7, the latest version of MySQL and a host of other server tweaks out of the box, this r oute was much quicker

About Nutrabay 

Nutrabay is a leading distributor and seller for health & 

fitness supplements in India. Listed as a seller on 15+ 

popular online stores, Nutrabay has a considerable 

distribution network that spans hundreds of physical 

locations. 

Nutrabay’s aim is to help anyone find health products 

that suit their lifestyle. A big part of achieving this goal 

is having a rock solid online store that helps users 

search and buy products from among the myriad of 

brands available in the market. 

 

Page 4: 6. Streamlining the Checkout Process · 2019. 10. 28. · caching, PHP7, the latest version of MySQL and a host of other server tweaks out of the box, this r oute was much quicker

Services delivered 

● Server migration and setup 

● Code profiling and optimisation 

● Development and support 

● Ongoing consultancy 

 

 

 

Page 5: 6. Streamlining the Checkout Process · 2019. 10. 28. · caching, PHP7, the latest version of MySQL and a host of other server tweaks out of the box, this r oute was much quicker

The Project 

 

The key challenge that Nutabay was trying to fix was 

getting their servers to scale past handling more than 

250 concurrent visitors. Further, code and setup 

inefficiencies were negatively affecting the experience 

that visitors had, reducing conversions and increasing 

bounce rates. Other issues included: 

1. Massive delays with any action that involved 

sending emails 

2. Excessive use of CPU resources  

 

Page 6: 6. Streamlining the Checkout Process · 2019. 10. 28. · caching, PHP7, the latest version of MySQL and a host of other server tweaks out of the box, this r oute was much quicker

Setting up Caching 

rtCamp started the project by conducting a review of 

Nutrabay’s servers and the code running on them. 

Baseline performance readings were collected at this 

point. 

rtCamp set up a new server using EasyEngine, an 

open-source server management tool developed 

in-house. Since EasyEngine can apply page and object 

caching, PHP7, the latest version of MySQL and a host of 

other server tweaks out of the box, this route was much 

quicker than setting each of these up on Nutrabay’s 

existing servers. 

By implementing object and page caching backed by 

Redis on the server level, rtCamp eliminated the need of 

a separate caching plugin. These caches worked to 

reduce the number of requests to the database, 

thereby reducing the load on the web server. Cache 

 

Page 7: 6. Streamlining the Checkout Process · 2019. 10. 28. · caching, PHP7, the latest version of MySQL and a host of other server tweaks out of the box, this r oute was much quicker

invalidation was added and tested to eliminate user 

session conflicts. 

During the process of migrating the site’s database 

from the old setup to the new one, rtCamp ensured that 

all database tables were utf8mb4 character encoded. 

This was to mitigate some issues that Nutrabay had 

been having due to mismatched encoding standards 

across tables. 

 

 

 

 

 

 

 

Page 8: 6. Streamlining the Checkout Process · 2019. 10. 28. · caching, PHP7, the latest version of MySQL and a host of other server tweaks out of the box, this r oute was much quicker

Codebase Optimizations 

rtCamp then turned its attention to page response 

times. This metric is particularly important for 

ecommerce sites as several important pages in the 

customer acquisition journey cannot be cached and 

thus have to be quickly served when a customer lands 

on them. 

To analyse the effect of the plugin and theme 

codebase, rtCamp configured New Relic APM on 

Nutrabay’s new server. A few rounds of load testing 

were then conducted using Loader.io. These tests, in 

conjunction with New Relic’s excellent reporting, helped 

rtCamp understand the bottlenecks in the server 

config. rtCamp cleaned up the wp-options, wp-cron, 

and some autoloaded data in wp_options tables. 

 

 

Page 9: 6. Streamlining the Checkout Process · 2019. 10. 28. · caching, PHP7, the latest version of MySQL and a host of other server tweaks out of the box, this r oute was much quicker

rtCamp observed that some plugins were frequently 

flushing the entire object cache of the site using 

wp_flush_cache. This excessive cache flushing was 

causing sudden CPU spikes. To fix this, rtCamp removed 

the code that was responsible for this behaviour. 

rtCamp also removed a few other plugins and 

replicated their functionality through lightweight 

custom code. 

Taken together, all of these measures ensured that 

Nutrabay’s servers were operating at maximum 

efficiency. 

 

 

Page 10: 6. Streamlining the Checkout Process · 2019. 10. 28. · caching, PHP7, the latest version of MySQL and a host of other server tweaks out of the box, this r oute was much quicker

 

Streamlining the Checkout 

Process 

The transition time between the checkout page and 

“thank you” page on Nutrabay’s old setup was 

unacceptably high. On investigation, rtCamp observed 

that the Sparkpost plugin was being used to deliver the 

various transactional emails to the customer and 

website administrator. 

rtCamp bypassed this by removing the SparkPost 

plugin from WordPress and configuring the service 

directly at server level using Postfix. This drastically 

reduced the transition time from 4-5 seconds to less 

than 1 second. 

 

Page 11: 6. Streamlining the Checkout Process · 2019. 10. 28. · caching, PHP7, the latest version of MySQL and a host of other server tweaks out of the box, this r oute was much quicker

 

 

Results 

rtCamp’s optimizations worked to streamline 

Nutrabay’s website. Server response time reduced by 

about 87%, page load times improved by more than a 

second on average, and Nutrabay’s servers are now 

capable of handling 1200+ concurrent users. The 

seemingly random CPU spikes no longer occur, and the 

Nutrabay’s checkout process is quicker than ever. 

 

 

Page 12: 6. Streamlining the Checkout Process · 2019. 10. 28. · caching, PHP7, the latest version of MySQL and a host of other server tweaks out of the box, this r oute was much quicker

 

 

rtCamp continues to work with Nutrabay for ongoing 

WooCommerce development and server maintenance. 

  

 

 

 

 

 

Page 13: 6. Streamlining the Checkout Process · 2019. 10. 28. · caching, PHP7, the latest version of MySQL and a host of other server tweaks out of the box, this r oute was much quicker

 

 

 

 

 

 

 

 

 

 rtCamp was founded in 2009 and has always worked 

exclusively with WordPress. We’ve grown by doing great 

work and building a great place to work: our tagline is 

“Good Work. Good People”.  

 

We build enterprise WordPress websites, higher 

performance eCommerce stores, and manage hosting 

infrastructure for the biggest brands including 

Facebook, News UK, and Vanguard. As one of the 

WordPress VIP partners world-wide, we craft the 

highest quality code and have access to the best 

 

Page 14: 6. Streamlining the Checkout Process · 2019. 10. 28. · caching, PHP7, the latest version of MySQL and a host of other server tweaks out of the box, this r oute was much quicker

WordPress infrastructure.