MySQL Tips for WordPress
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,734
On Slideshare
1,339
From Embeds
395
Number of Embeds
7

Actions

Shares
Downloads
6
Comments
0
Likes
0

Embeds 395

http://blog.dsero.com 285
http://wptlv.org 66
http://www.wptlv.org 35
http://wptlv.org.il 4
https://www.linkedin.com 3
http://translate.googleusercontent.com 1
http://www.linkedin.com 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • http://www.prelovac.com/vladimir/wordpress-optimization-guide

Transcript

  • 1. info@dsero.com http://www.dsero.comThe Anti AdBlock Creators
  • 2. The Original Site…
  • 3. With AdBlock
  • 4. dSero Anti AdBlock is The Solution
  • 5. The Engine Behind this Site is MySQL
  • 6. What WordPress is Made Of? HardwareNetwork Apache MySQL Linux PHP http://www.perforce.com/blog/110607/how-do-they-do-it-googles-one-server-trick http://kleanpc.com/cms/services/linux-implementations/ http://www.w3resource.com/mysql/mysql-tutorials.php http://aserverblog.blogspot.co.il/2012/02/apache-releases-v2222-for-apache-http.html http://www.makemoneyinlife.com/make-money-with-php-scripts-and-programming.html http://www.glosecgroup.com/index.php?pid=2&menu=134&open=6&item_id=0&div=5
  • 7. What Our Database is made of?Name Engine Rows Row (B) Data (KB) Index (KB)wp_commentmeta InnoDB 297 496 147 32wp_comments InnoDB 99 827 81 65wp_links InnoDB 7 2340 16 16wp_options InnoDB 171 12743 2179 16wp_postmeta InnoDB 340 289 98 32wp_posts InnoDB 689 3448 2375 163wp_term_relationships InnoDB 74 221 16 16wp_term_taxonomy InnoDB 38 431 16 32wp_terms InnoDB 38 431 16 32wp_usermeta InnoDB 61 268 16 32wp_users InnoDB 3 5461 16 32
  • 8. What wp_post is made of?post_type # %revision 501 84%attachment 63 11%post 21 4%nav_menu_item 5 1%page 5 1%
  • 9. #1: Consider Avoiding Revisions wp-config.php  define(WP_POST_REVISIONS, false); MySQL  DELETE FROM wp_posts WHERE post_type = "revision";
  • 10. #1: Consider Avoiding Revisions wp-config.php  define(WP_POST_REVISIONS, false); MySQL  DELETE FROM wp_posts WHERE post_type = "revision";
  • 11. #2: Optimize RAM Usage Preferred: SizeOf(database) < SizeOf(RAM) innodb_buffer_pool_size  50-70% of your RAM
  • 12. Do We Utilize the Cache? SHOW STATUS LIKE Qcache%;Qcache_free_blocks 718Qcache_free_memory 13004008Qcache_hits 780759Qcache_inserts 56292Qcache_lowmem_prunes 0Qcache_not_cached 3711Qcache_queries_in_cache 1715Qcache_total_blocks 4344
  • 13. #3: Cache Queries query_cache_type = 1 query_cache_limit = 1M query_cache_size = 16M
  • 14. #4: Buffer Optimization key_reads/key_read_requests < 0.01 If not  Increase Key Buffer
  • 15. #5: CPU Optimization thread_concurrency = 2 X #(CPU Cores)
  • 16. #7: Run MySQLTuner.pl + Tuning-Premier.shhttp://www.farhanfaisal.com/2010/11/fine-tuning-apache-and-mysql-for-performance-and-security/
  • 17. #8: Enable Slow Query Regular Joins w/o Indexesmysql> explain SELECT COUNT(*), post_type FROM wp_posts GROUP BY post_type;+----+-------------+----------+-------+---------------+------------------+---------+------+------+-------------+| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra+----+-------------+----------+-------+---------------+------------------+---------+------+------+-------------+| 1 | SIMPLE | wp_posts | index | NULL | type_status_date | 140 | NULL | 693 | Using index+----+-------------+----------+-------+---------------+------------------+---------+------+------+-------------+1 row in set (0.02 sec)
  • 18. #9: Multiply Database Servers
  • 19. #10: BackUp Consistent mysqldump Slave Backup XtraDB
  • 20. #11: Security Root User w/ Permissions to WordPress DB only Keep FireWall closed:  3306  Only relevant IPs
  • 21. info@dsero.com http://www.dsero.comJoin the Battle for the Blogosphere!