您好,欢迎访问三七文档
HighPerformanceWordPressGarethDaviesWhyperformance?•Speed•sopeopledon’twait•Scale•serveasmanyrequeststoasmanypeopleaspossible,concurrentlyLAMP•Astack•LAMP•Linux•Apache•MySQL•PHPWordPress•WritteninPHP•UsesMySQLasthedatabase•Apache/nginxcanbeusedforHTTPWordPress•Core(installed)•Themes•PluginsOSLevelTuning•You’re64-bitbynow•Logerrors,andnothingelse•TCP/IPsettings•OnlyrunservicesthatyouneedonaserverOSLevelTuning•Simplefirewalltostopbots•Readlogfilesfromlogwatch--hardwarediestoo•vmem.sh•Filesystem-XFSisbest,EXT3,EXT4areOKtooApache•TuneApache(httpd.conf)•ab&httperf•MaxClients•DefaultsareusuallyhorribleMySQL•Defaultsareterrible,usemy.cnf•mysqltuner.pl,tuningprimer.sh•mytop•Usemaatkit+mk-query-digest•Seegeneral&slowquerylog(foryourpluginproblems)•InnoDBisbetterforconcurrency,thoughbydefaultyou’reprobablyusingMyISAM•mysqlslapforbenchmarkingPHP•Memorysettings•Opcodecache•XCache,EAccelerator,APC•php.iniWordPress•Pluginsareoftenhorriblycoded•ThemescanhavedirectcallstothedatabaseWordPress•Lookatwp_optionstables•Disableplugins•TrythenewTwentyTentheme•wp_config.php:WP_HOME,WP_SITEURLStillstruggling?•ContentDeliveryNetworks(CDN)•Minify•CachingWPCaches•WPSuperCache•W3TotalCacheMoreyoucando•usemod_proxyandservestaticcontent•CDN:AmazonS3+CloudFrontisaffordable•usebrowsercache(setlongexpires)Separatemachines•2machines•webserver•databaseserver•memcachedservers?Varnish•Varnishserveseverythingfrommemory•httpdonadifferentport,runvarnishonport80andpointittohttpdportFurthergrowth•ItsnowtimetothinkaboutMySQLreplication(master-slavesetups)•memcachedtokeepcachesofqueryresults(upto1M)inmemory•HyperDBsupportsdatapartitioning,andcanreadfrommultipledatabasesWordPress.COM•severalbillionHTTPqueriesperday,billionsofMySQLqueriestoo•HPhardware,allSSDHipHopfromFacebook•••~2.7ximprovementinperformanceFindMe•@ShaolinTigeronTwitter•–MyBlog•shaolintigeratgmail–Emailme
本文标题:LAMP架构
链接地址:https://www.777doc.com/doc-3875950 .html