wordpress zurich meetup #5: mobilesport.ch insights

19
WordPress Zurich Meetup Mobilesport.ch - Insights 02. Juni 2014

Upload: blogwerk-ag

Post on 19-May-2015

357 views

Category:

Internet


1 download

DESCRIPTION

Insights about one of our recent projects mobilesport.ch

TRANSCRIPT

Page 1: WordPress Zurich Meetup #5: mobilesport.ch insights

WordPress Zurich MeetupMobilesport.ch - Insights

02. Juni 2014

Page 2: WordPress Zurich Meetup #5: mobilesport.ch insights

Table of contentsmobilesport.ch - Insights

- What is the idea of mobilesport.ch- Main goals of the relaunch- A few statistics

- Does „strong“ hardware make your WordPress faster?- Nginx vs. Apache- Site caching, AJAX and memcached

- Used plugins- The WPML struggle is real- Learnings

Page 3: WordPress Zurich Meetup #5: mobilesport.ch insights

What is the idea of mobilesport.chmobilesport.ch - Insights

- Platform for sports trainers and teachers- …And other people who are keen on sports- Search and find exercises covering their needs- Put exercises together on lists- Re-use and share exercise lists with others

- And of course: Use the contents in their lessons or maketheir own lessons to keep themselves fit

Page 4: WordPress Zurich Meetup #5: mobilesport.ch insights

What is the idea of mobilesport.chmobilesport.ch - Insights

Page 5: WordPress Zurich Meetup #5: mobilesport.ch insights

What is the idea of mobilesport.chmobilesport.ch - Insights

Page 6: WordPress Zurich Meetup #5: mobilesport.ch insights

What is the idea of mobilesport.chmobilesport.ch - Insights

Page 7: WordPress Zurich Meetup #5: mobilesport.ch insights

Main goalsmobilesport.ch - Insights

- 1. Faster response times- 2. Easier to handle and filter sports exerices- 3. Refactor / modernize code base (our goal)

Page 8: WordPress Zurich Meetup #5: mobilesport.ch insights

A few statisticsmobilesport.ch - Insights

- 11‘950 posts- 4‘222 in german, 4‘171 in french, 3‘557 in italian- 191‘457 post meta data records

- 1‘440 terms- 223‘578 term relationships- 1‘258 registered users- 2‘387 favorite lists- 33‘377 list items

- And this, combined with the WPML plugin isessentially what made it slow.

Page 9: WordPress Zurich Meetup #5: mobilesport.ch insights

Does „strong“ hardware make your WordPress faster?

mobilesport.ch - Insights

Page 10: WordPress Zurich Meetup #5: mobilesport.ch insights

Does „strong“ hardware make your WordPress faster?

mobilesport.ch - Insights

- More CPU or RAM != Faster Request- More CPU/RAM == More Request/sec- More RAM == More possibilities to cache

How to make a single request faster?

- Fast basic installation (i.e. nginx/php5-fpm/hhvm)- Write efficient code- Cache as much as possible

Page 11: WordPress Zurich Meetup #5: mobilesport.ch insights

nginx vs. apache2 - Installationmobilesport.ch - Insights

Live Machine Test Machine

Installation Type Physical Server VPS / Amazon EC2

CPU 2x6 2.5 GHz Cores (Xeon) 1 vCPU (Xeon E5-2670)

RAM 8x8 GB (64GB total) 3.75 GB

Harddisks Native SSD EBS Network Storage

Webserver Apache 2.2.22 Nginx 1.4.1

PHP Installation mod_php5 / apache2handler php5-fpm

PHP Version PHP 5.4.x PHP 5.5.x

MySQL Version 5.5.37 5.5.37

Memcached 1.4.14 1.4.14

Page 12: WordPress Zurich Meetup #5: mobilesport.ch insights

nginx vs. apache2 - Resultsmobilesport.ch - Insights

Live Machine Test Machine

Uncached Request (HT Disabled) 1.1s – 1.3s Not tested

Uncached Request (HT Enabled) 700 – 800ms 400 – 500ms

WordPress Ajax Request 200 – 350ms 100 – 200ms

Cached Request (HTML Cache) 30 – 60ms 20 – 50ms

Cached Requests/sec - simple siege ~2500 Req/s ~180 Req/s

Cached Requests/sec – CPU Usage 10-15% 20-30%

Uncached Requests/sec - simple siege ~50 Req/s ~20 Req/s

Uncached Requests/sec – CPU Usage 30-35% +100%

Page 13: WordPress Zurich Meetup #5: mobilesport.ch insights

Site caching, AJAX, memcachedmobilesport.ch - Insights

What makes the new mobilesport.ch faster?

- Site caching (Serving cached sites from wp-config.php)- Using AJAX for dynamic content- Don‘t load certain modules while DOING_AJAX- Cache complex business logic (wp_cache_*)- Cache complex DB queries- Use memcached as WP_Object_Cache

Page 14: WordPress Zurich Meetup #5: mobilesport.ch insights

Pluginsmobilesport.ch - Insights

Which plugins did we use?

- Antispam Bee- Contact Form 7- Google XML Sitemaps- Installer (Especially for WPML)- JWPlayer 6 Plugin- TinyMCE Advanced- WPML- wpSEO

Page 15: WordPress Zurich Meetup #5: mobilesport.ch insights

The WPML struggle is realmobilesport.ch - Insights

Maybe you have seen tweets like these:

Page 16: WordPress Zurich Meetup #5: mobilesport.ch insights

The WPML struggle is realmobilesport.ch - Insights

What were the problems

- Various bugs with memcached- Looks like WPML is not actually tested for persistent caching- Proper cache invalidation missing- Very slow support

- Support answers quite fast, but…

- Solutions are developed slowly (or not at all)- New (major) bugs with every update- We are live, but there are still unfixed bugs

- Memcached is „completely disabled“ in backend- Features like bulk editing removed

Page 17: WordPress Zurich Meetup #5: mobilesport.ch insights

The WPML struggle is realmobilesport.ch - Insights

What were the problems

- Various bugs with memcached- Looks like WPML is not actually tested for persistent caching- Proper cache invalidation missing- Very slow support

- Support answers quite fast, but…

- Solutions are developed slowly (or not at all)- New (major) bugs with every update- We are live, but there are still unfixed bugs

- Memcached is „completely disabled“ in backend- Features like bulk editing removed

Page 18: WordPress Zurich Meetup #5: mobilesport.ch insights

Learningsmobilesport.ch - Insights

- We‘re not going to use WPML anymore- Hint: We migrated every project to our own ML solution- Mobilesport.ch is our last project where we use WPML

- When using memcached- …Make sure you have enough RAM allocated- …Make sure that all plugins work properly

- If possible, use nginx/php5-fpm configurations- You might want to try hhvm instead of php5-fpm- Refactoring a whole code base needs a lot of analysis- Updating WordPress or a plugin can cause serious

issues

Page 19: WordPress Zurich Meetup #5: mobilesport.ch insights

Michael Sebel

Software-EngineerTwitter: @msebel [email protected]

Questions and contactmobilesport.ch - Insights