3. APACHE
World's most widely used web server
Dynamic loadable modules
Language support: Perl, Python, PHP and ...
It’s being used by many high traffic websites
Easy virtual hosting
4. NGINX
Low memory footprint
Language support: Ruby, Python, PHP and ...
Reverse proxy, Load balancer and HTTP cache
5. REVERSE PROXY
Hide the existence and characteristics of an origin server or servers
Protect against common web-based attacks, such as DOS or DDOS
Can do SSL termination [SSL termination proxy]
Load balancing
Caching
Compressing content
7. HTTP CACHE
Http Cache Backend
Is
Cached?Http Request
Cache Hit
Cache Miss
Yes
No
Cache Response
Backend response
8. MYSQL VARIABLES YOU SHOULD
CARE
innodb_buffer_pool_size
innodb_log_file_size
max_connections
innodb_file_per_table
query_cache_size
log_bin
skip_name_resolve
9. SOME POINTS ON MYSQL ( /ETC/MY.CNF )
Mysql Server Memory Usage = core_mysql + Sum of Global Buffers + (number of Connection * Per thread memory variables)
Global buffers include:
key_buffer_size, innodb_buffer_pool_size, innodb_additional_mem_pool_size, innodb_log_buffer_size,
query_cache_size
Each thread for client connection uses:
thread_stack, net_buffer_length, max_allowed_packet, read_buffer_size, rean_rnd_buffer_size,
tmp_table_size, sort_buffer_size
Per thread variables include:
read_buffer_size, read_rnd_buffer_size, sort_buffer_size, join_buffer_size, thread_stack, net_buffer_length,
max_allowed_packet
10. USEFUL TOOLS FOR MYSQL
MySQLTuner-perl: http://mysqltuner.com/
MySQL Tuning Primer: https://launchpad.net/mysql-tuning-primer
Percona Toolkit: https://www.percona.com/doc/percona-
toolkit/2.2/index.html
13. SERVING REQUESTS
Backend 1
Is
Static File?Http Request
No Hit on backed
Hit From Backend
Yes
No
Backend 2
File System
Round-robin or
other scheduling
algorithms
14. PHP-FPM
It’s an alternative PHP FastCGI implementation
Initial configuration is strait-forward
15. PHP
Use memcache for sessions (php.ini):
session.save_handler = memcached
session.save_path = "localhost:11211“
Enable and config PHP’s OPCache
PHP has 2 modules (memcache and memcached) for communication
with memcached (software), always use “memcached”
16. SECURITY!
Install and use CSF and Fail2Ban, else I assure you the pain is coming.
Always run ‘mysql_secure_installation’ after MySQL installation
17. ENDED, BUT NOT FINISHED
Follow your dreams, but care to eat less before dreaming.