Tema: La Scala di Moodle
De:
A:
Martín Langhoff <
[email protected]>
MoodleMoot CO 2010
ONE LAPTOP PER CHILD
This work is licenced under a Creative Commons Attribution 2.5 Licence.
Historia universal de la
escalabilidad
● Elecciones en NZ
● 1.4.3 a 1.6
● 1.9 reimplementación de roles
● Trabajo con grandes instalaciones
(NZ, UK, Australia, España)
● No estamos solos
ONE LAPTOP PER CHILD
This work is licenced under a Creative Commons Attribution 2.5 Licence.
Entender y Medir
● Protocolo HTTP
– Usuarios simultáneos
vs Hits/Pageviews
● Foco: Tajadas 5s
● Patrones de uso y carga
– 100 usuarios en 5s
– proyectar o medir
ONE LAPTOP PER CHILD
This work is licenced under a Creative Commons Attribution 2.5 Licence.
Proyectando
● Login
● Homepage
● Página curso
● Módulo
● 'Hub' distribuidor
● Modelar en base a pruebas
ONE LAPTOP PER CHILD
This work is licenced under a Creative Commons Attribution 2.5 Licence.
Medir en producción
● Perfstats (al log!)
● “Top Ten” de la semana!
● Usuarios distintos por hora
● Picos de pageviews / hits
ONE LAPTOP PER CHILD
This work is licenced under a Creative Commons Attribution 2.5 Licence.
Configuraciones
● Servidor único
● Cluster
● VMs
ONE LAPTOP PER CHILD
This work is licenced under a Creative Commons Attribution 2.5 Licence.
Servidor Unico
● Memoria > Discos > CPU
● Asignar RAM: 30% Pg, 60% Apache/PHP
● Kernel / OS
– Sin GUI
– Sysstat
– Parametros sysctl (vm.dirty_*,
kernel.shmmax)
– Formato y montado de discos (journalling,
noatime)
ONE LAPTOP PER CHILD
This work is licenced under a Creative Commons Attribution 2.5 Licence.
Servidor Unico
● Apache
– MaxRequestsPerChild
– MaxClients
– KeepAliveTimeout
– Memoria: ps_mem.py, top
ONE LAPTOP PER CHILD
This work is licenced under a Creative Commons Attribution 2.5 Licence.
Servidor Unico
● PostgreSQL
– Unix Socket!
– shmem
– Configurar para más memoria
– maxconnections = Apache MaxClients
(solo si hay una sola DB y usuario)
– Disco txlog (sin journalling)
– Porqué Pg?
ONE LAPTOP PER CHILD
This work is licenced under a Creative Commons Attribution 2.5 Licence.
ONE LAPTOP PER CHILD
This work is licenced under a Creative Commons Attribution 2.5 Licence.
Ejemplos de costos y algoritmos
● Loops controlado por los datos de un
query
– Query afuera del loop obtiene los datos
necesarios
– El loop los procesa
– El loop no hace ningun query!
● Funciones en librerias tienen que declarar
si hacen queries -- idealmente, deben
actuar sobre los parametros
ONE LAPTOP PER CHILD
This work is licenced under a Creative Commons Attribution 2.5 Licence.
Algoritmos y costos
- Minimizar los archivos cargados /
interpretados
- librerias requeridas
"justo a tiempo"
- clases instanciadas
"justo a tiempo"
ONE LAPTOP PER CHILD
This work is licenced under a Creative Commons Attribution 2.5 Licence.
Caches
Ultimo recurso
- Altos costos
- HTTP es no-persistente
- Diseñar estructuras de datos
- Pocas garantias de localidad
- Costos de sincr en clusters
- Costos en serialize/unserialize
ONE LAPTOP PER CHILD
This work is licenced under a Creative Commons Attribution 2.5 Licence.
La ley de Moore
- programador: quiere ser mas perezoso
- dueño del servidor quiere mas
prestaciones Y mas
usuarios/cursos/trafico!
- La diferencia entre eficiente y no
eficiente esta en magnitudes
- Puedes hacer cosas imposibles
ONE LAPTOP PER CHILD
This work is licenced under a Creative Commons Attribution 2.5 Licence.
Porque Google?
- Hacen lo previamente pensado imposible
- Herramientas simples + disciplina
intelectual
- Publican papers y código
- Revolucionario
ONE LAPTOP PER CHILD
This work is licenced under a Creative Commons Attribution 2.5 Licence.
Divide y conquista
- Divide en tareas que dividen el espacio
de datos y son paralelizables
- Segmentar el espacio, aumentar
"localidad" de los datos
- Bloques grandes de datos - corte vertical
- Map/Reduce
- BigTable
- GFS
ONE LAPTOP PER CHILD
This work is licenced under a Creative Commons Attribution 2.5 Licence.
Goodle?
- Largo camino al modelo puro de Google,
diseño puramente distribuido
- Moodle esta centrado en el curso y el
usuario
- Afinidad webserver -> curso
- Cache local fuerte -- HD, shmem
- ejemplo: mod/chat
ONE LAPTOP PER CHILD
This work is licenced under a Creative Commons Attribution 2.5 Licence.
Resumiendo
● Ojectivos del diseño
● Probarlo
● Ejemplos de algoritmos y costos
● Algoritmos y costos
● Caches?
● La ley de Moore
● Porqué Google
● Divide y conquista
● Goodle
ONE LAPTOP PER CHILD
This work is licenced under a Creative Commons Attribution 2.5 Licence.
Comentarios de: La Scala di Moodle (0)
No hay comentarios