Más contenido relacionado La actualidad más candente (20) Similar a Steve Corona: Scaling LAMP doesn't have to suck (20) Steve Corona: Scaling LAMP doesn't have to suck12. open files
default is 1024
on linux, each socket = open file
/etc/security/limits.conf
soft nofile 999999
hard nofile 999999
13. sysctl tuning
thousands of settings
newer kernels autotune network
/etc/sysctl.conf
net.core.somaxconn=999999
net.ipv4.ip_local_port_range=2000 62000
net.ipv4.tcp_tw_recycle=1
vm.swapiness=0
14. i/o scheduler
linux has swappable scheduler
default is cfq
$ echo “deadline” >
/sys/block/sda/queue/scheduler
+50% IOPS on MySQL
24. php + mysql
mysql persistent
connections are GOOD
to use.
despite what the internet says
26. php + mysql
watch out for thundering
herd
mysql’s max_connections
2(pm.max_children * #
servers)
27. php + mysql
turn on mysql protocol
compression
$m = mysqli_init();
$m->real_connect($username....,
MYSQL_CLIENT_COMPRESS);
38. nsq
message queue server in golang by
bit.ly
we use it to process 370 million
events/day
https://github.com/bitly/nsq
39. nsq
•nsqphp is best php library
•pub/sub model
•do work async
•api calls
•defer long-running work
https://github.com/davegardnerisme/nsqphp