Monkey HTTP Daemon :: A fast and scalable web server for Linux Eduardo Silva
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● HTTP: HyperText Transfer Protocol ● Monkey HTTP Daemon: A small, fast and scalable web server
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● ¿ Que es ? ● HTTP Server ● Transferencia de recursos: páginas, imágenes, flash, etc ● Hay muchos! Apache, Lighttpd, IIS.. ¿ por que otro ?. ● Ya no son 1000 usuarios, son millones !!!
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● Administración y uso eficiente de los recursos ● Compatible con standards ● Java Script engine ● Multi plataforma
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● Redirección en la solicitud de directorios ● Listando contenido de directorios
Monkey HTTP Daemon :: A fast and scalable web server for Linux GET /imgs HTTP/1.1 Host: :2001 Keep-Alive: 300 Connection: keep-alive HTTP/ Moved Permanently Server: Monkey/-git Server (Host: , Port: 2001) Location: GET /imgs/ HTTP/1.1 Host: :2001 Keep-Alive: 300 Connection: keep-alive HTTP/ OK Server: Monkey/-git Server (Host: , Port: 2001) Date: Thu, 23 Oct :17:34 GMT
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● Funcionalidad “adquirida” ● Consumo innecesario de recursos ● A todos les gusta y les sirve ● Propuesta: El cliente HTTP ordena el contenido y lo pinta.
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● Archivos no son suficientes ● Es necesario generar páginas dinámicas ● PHP, Python, Ruby.... ● Databases
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● Virtual hosts ● CGI: Common Gateway Interface ● Performance !!!
Monkey HTTP Daemon :: A fast and scalable web server for Linux
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● Protocolo standard ● Permite integración de aplicaciones externas
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● Implementaciones poco eficientes ● Consumo de recursos en exceso ● fork() + fork() + fork() = ???
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● Fast CGI ● Simple CGI ● Youtube scalability ● Logs
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● High Performance ● Pre-forking() ● Carga distribuida
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● Similar a FastCGI : carga distribuida, pre-forking(), high perf. ● Simple de implementar ● Especificacion en 100 lineas de texto
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● 03/2006: 30 millones de videos/día ● 07/2006: 100 millones de videos/día ● Apache -> Lighttpd ● Single Process -> Multi Process
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● Single Process ● Multi Threads Thread #1 Read Write Read Write Read Write Thread #2 WriteRead
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● Un servidor debe registrar el acceso a los recursos: Logs
Monkey HTTP Daemon :: A fast and scalable web server for Linux request/second = 1000 I/O/second ????????????
Monkey HTTP Daemon :: A fast and scalable web server for Linux SOLO PARA LINUX...
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● Es mi favorito ● SW Multiplataforma = Costo en tiempo + desarrolladores ● Libre, estable...blah blah blah
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● epoll() ● splice() ● tee() ● timerfd() ● sendfile() ● Inotify
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● Fork per client ● Pre-forking ● Threading ● Pre-threading ● Polling ● Hybrid Threading-Polling
Monkey HTTP Daemon :: A fast and scalable web server for Linux 2001 ● 1 proceso por client (1 fork() per client) ● CGI básico
Monkey HTTP Daemon :: A fast and scalable web server for Linux 2002 ● 1 thread por cliente ● Hosts virtuales ● CGI en hosts virtuales
Monkey HTTP Daemon :: A fast and scalable web server for Linux 2003 ● MySQL logs
Monkey HTTP Daemon :: A fast and scalable web server for Linux 2008 ● Hybrid Network Handler: threads + polling ● Dir html : Soporte para temas dinámicos ● Worker logger ● Async sendfile()
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● Interface para la distribución de eventos ● Listo para escuchar ? ● Listo para escribir ? ● Permite utilizar un modelo “Asíncrono” (async model)
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● Binary size: 52KB !!! ● Ventajas de un Hybrid model: Threading + Polling ● Worker – process ● dir_html: soporte para temas ● Sólo para Linux !!! ● Simple de configurar
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● Thread que espera por datos en una tubería ( pipe() ) ● No vacia la tubería hasta que esta llega a su 75% de capacidad o han pasado 3 segundos
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● Cada Thread posee un poll de conexiones entrantes ● Un balancer central recibe las conexiones y solicitudes ● El balancer asigna la petición de un cliente al poll de un thread seleccionado. ● En cada thread, cada conexion de cliente se trabaja de forma asíncrona.
Monkey HTTP Daemon :: A fast and scalable web server for Linux
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● Diseño modular ● SSL ● IPv6 ● FastCGI, SCGI ● Servidor de procesos para contenido dinámico propio
Monkey HTTP Daemon :: A fast and scalable web server for Linux ● Escribiendo código ● Creando documentación ● Traduciendo ● Creando Art Work ● Reportando bugs
Monkey HTTP Daemon :: A fast and scalable web server for Linux
Monkey HTTP Daemon :: A fast and scalable web server for Linux