Se ha denunciado esta presentación.
Se está descargando tu SlideShare. ×

AWS Summits América Latina 2015 EC2 Avanzado

Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Cargando en…3
×

Eche un vistazo a continuación

1 de 39 Anuncio

Más Contenido Relacionado

Presentaciones para usted (18)

Anuncio

Similares a AWS Summits América Latina 2015 EC2 Avanzado (20)

Más de Amazon Web Services LATAM (20)

Anuncio

Más reciente (20)

AWS Summits América Latina 2015 EC2 Avanzado

  1. 1. México D.F.
  2. 2. EC2: Avanzado Henry Alvarado Arquitecto de soluciones Amazon Web Services
  3. 3. • Qué es la plataforma de instancias EC2 y una pequeña cartilla sobre virtualización. • Cómo obtener lo máximo de su experiencia con EC2 desde la lente de tres tipos de instancias? • Cómo pensar sobre el futuro de las instancias EC2 Agenda
  4. 4. Plataforma de instancias EC2
  5. 5. EC2 EC2
  6. 6. Amazon EC2 Instances Host Server Hypervisor Guest 1 Guest 2 Guest n
  7. 7. c3.large Familia Generación de la instancia Tamaño
  8. 8. Cartilla en virtualización: x86 CPU • Antes de Intel VT-x – Traducción binaria – Para-virtualization (PV) • Luego de Intel VT-x – Virtualización asistida por hardware (HVM) • PV vs. HVM Amazon Machine Images • Opciones de agendamiento vCPU y variabilidad
  9. 9. Host Server Hypervisor Guest 1 Guest 2 Guest n
  10. 10. Cartilla en virtualización: I/O and Devices • Agendamiento de I/O requests entre dispositivos virtuales y hardware físico compartido • Modelo de driver separado para dispositivos compartidos; requiere recursos de host • Intel VT-d – Direct pass through y IOMMU para dispositivos dedicados
  11. 11. Nuestra filosofía • Más grande, más rápido, más económico, consistente y flexible • Nuestro objetivo en performance es el bare metal • Los clientes nos ayudan a priorizar nuestro roadmap • Mirada bajo el capó a través de la lente de tres nuevas plataformas: C4, T2 e I2
  12. 12. Cómo obtener el máximo de su experiencia con EC2
  13. 13. Instancias T2: Bajo costo
  14. 14. Instancias T2: Resumen • Instancias EC2 de bajo costo. Hasta $0.013 por hora. • Performance Variable vs. Fijo Name vCPUs Baseline Performance Platform RAM (GiB) CPU Credits / Hour t2.micro 1 10% 32-bit or 64-bit 1 6 t2.small 1 20% 32-bit or 64-bit 2 12 t2.medium 2 40% 32-bit or 64-bit 4 24 t2.large 2 60% 64-bit 8 36NEW!
  15. 15. Tip: Entienda cómo funcionan los créditos de CPU • http://aws.amazon.com/blogs/aws/low-cost- burstable-ec2-instances/ • http://aws.amazon.com/ec2/instance-types/t2/ • Attend this session
  16. 16. Cómo funcionan los créditos? Baseline Rate Credit Balance • Un crédito de CPU provee el performance de un core de CPU completo por un minuto. • Una instancia gana créditos de CPU a una tasa constante. • Una instancia consume los créditos cuando está activa. • Los créditos expiran (desbordan) en el tiempo. Burst Rate
  17. 17. Los créditos de CPU • Un crédito de CPU provee el performance de un core de CPU completo por un minuto. • Se provee con una balance inicial de créditos para una buena experiencia durante el arranque. • Se usan créditos cuando se está activo y se acumulan cuando se está en reposo. • Transparentes con los balances de créditos.
  18. 18. Tip: Monitoree sus créditos de CPU
  19. 19. Instancias I2: Alto I/O
  20. 20. Instancias I2: Resumen • 16 vCPU: 3.2 TB SSD; 32 vCPU: 6.4 TB SSD • 365K random read IOPS for 32 vCPU instance Model vCPU Memory (GiB) Storage Read IOPS Write IOPS i2.xlarge 4 30.5 1 x 800 SSD 35,000 35,000 i2.2xlarge 8 61 2 x 800 SSD 75,000 75,000 i2.4xlarge 16 122 4 x 800 SSD 175,000 155,000 i2.8xlarge 32 244 8 x 800 SSD 365,000 315,000
  21. 21. Host Server Hypervisor Guest 4 Guest 5 Guest 6 Host Server Hypervisor Guest 1 Guest 2 Guest 3
  22. 22. Tip: Use el kernel 3.8+ • Amazon Linux 13.09 or later • Ubuntu 14.04 or later • RHEL7 or later • Etc.
  23. 23. Antes de los Kernels -3.8.0 • Todos los I/O deben pasar a través del I/O Domain • Requiere un “grant mapping” antes del kernel 3.8.0 • Grant mappings son operaciones costosas debido a los TLB flushes read(fd, buffer, BLOCK_SIZE)
  24. 24. 3.8.0+ Kernels – Persistente e indirecto • Grant mappings son definidos por grupos una sola vez • La data es copiada desde y hacia el grant pool • El copiado es significativamente más rápido que el re mapeo read(fd, buffer, BLOCK_SIZE)
  25. 25. Tip: Ejecute TRIM o realice Overprovision
  26. 26. SSDs y Wear Leveling • FLASH tiene un número limitado de escrituras por cada sector físico – Los sectores se degradan; deben ser borrados antes de re escribir en ellos – Borrar coloca a todo 1s, lo que es lento • Los firmware modernos son muy sofisticados para extender la vida de FLASH • TRIM y/o over provisioning ayuda a evitar el garbage collection y el write amplification
  27. 27. Capa de traducción Flash • Todas las escrituras van al TAIL • Escritas aleatorias == Escritas secuenciales • Desgaste homogéneo de los sectores (Wear Leveling) HEAD TAIL
  28. 28. Garbage Collection • Nuevas escrituras tienen que buscar espacio disponible. • Resulta en pausas de garbage collection • Grandes escrituras pueden requerir desfragmentación. HEAD TAIL
  29. 29. Instancias C4: Alto poder de Cómputo
  30. 30. Instancias C4: Resumen • Intel E5-2666 v3 at 2.9 GHz • EBS-Optimized por defecto • Enhanced networking Model vCPU Memory (GiB) c4.large 2 3.75 c4.xlarge 4 7.5 c4.2xlarge 8 15 c4.4xlarge 16 30 c4.8xlarge 32 60
  31. 31. Tip: Usen PV-HVM AMIs con EBS
  32. 32. Por qué PV-HVM es más rápido que PV • PV-HVM permite al Application llamar directamente al Kernel • PV requiere ir a través del VMM • Las aplicaciones que son restrictas a llamadas del sistema son las más afectadas. Kernel Application Kernel Application VMM Application VMM Kernel Bare Metal PV-HVM PV
  33. 33. Tip: Usen TSC como clocksource
  34. 34. Manteniendo el tiempo • Llevar el tiempo en una instancia es engañosamente difícil • gettimeofday(), clock_gettime(), QueryPerformanceCounter() • El TSC – Contador de CPU, accesible desde el userspace – Sin cambios a partir de los procesadores Sandy Bridge+ • Por defecto está el Xen pvclock. • En las generaciones actuales de instancias, use TSC como clocksource
  35. 35. Resumen
  36. 36. Resumen • Esta información es solo la superficie de lo que podríamos hablar • Pasen por la documentación de EC2 para más trucos y tips
  37. 37. EC2 EC2

Notas del editor

  • El equipo de EC2 pasa mucho tempo hablando con los clientes, mirando entre datos de uso y qué construir luego.
    Documento interno de product requests totalmente basado en las experiencias de los usuarios.
    Pasan largas horas en la noche para lograr desplegar nuevas instancias y que ustedes reciban un email de algo nuevo en EC2.
  • Hablar de 3 cosas
    EC2 y la evolución de la virtualización
    Como obtener lo mejor de su experiencia de uso con EC2 para que se lleven una seria de mejores prácticas.
    Como va a ser el futuro de EC2
  • Amazon Elastic Compute Cloud es un servicio web que hace más facil para ustedes obtener servidores virtuales de forma rápida, económica y sin invertir en capex.
    Ok, todos sabemos eso..
  • Esta charla realmente es difícil de dar porque tiene demasiados temas posibles para cobrir. APIs/Redes/Pricing models/Instancias como tal..
    Vamos a hacer entonces algo un poco más enfocado.
    En seguida VPC a profundidad (Avanzando) y a la 1:15 Almacenamiento y respaldo en AWS (Principiante).
    Al incio solo m1.small 2GB de memoria. Rápidamente percibimos que el cliente requería variedad para diferentes cargas.



    When you own the hardware and rent it, rather than sell it, everything changes. We understand much more intimately how customers use the hardware, and we become obsessed with total cost of ownership.
    The selection of instances has grown, now reaching 44 instances. And over the past 2 years we’ve grown disproportionately compared to previous years.
    What’s enabled us to do this and how do we make sense of the options?

    The EC2 platform is the engine that allows us to produce new instance sizes quickly to meet the needs of different workload segments
    It’s the hardware and the hypervisor depicted a couple slides ago, it’s the EC2 control plane, and it’s also a procurement and supply chain teams, and datacenter operations teams
    Lot’s of technologies, teams, and processes tat make up the EC2 platform.
    With the platform we’re able to ingest new technologies to do one of two things, either create a new instance family to address a different market segment, or bring forward a new generation which serves an existing segment with more performance, new feature, and or lower prices.
    As technology improves, we want to ensure customer are able to benefit from improvements in CPU, SSD, and other components. We do this through our current generation instance types.
  • Nivelarnos em conocimientos
    Encontramos y administramos el hardware para rodar sus instancias


    EC2 instances are virtual machines that are spun up when you issue an ec2-run-instances call, or a ec2-start-instances call
    We find available hardware and signal the hypervisor to create your virtual machine instance
    We then hand over the SSH keys or the Windows Administrator password, and its yours to do as you please
    Server often have more processing power than your application needs, and virtual machines provide us a way to consolidate a number of instances on a single host, providing you low prices while also preserving isolation
    So there can be multiple virtual machines per host and there is sometimes only one virtual machine per host, depending on the instance size
  • Definimos las instancias de forma similar a como usted lo haría con un servidor.
    Optimizamos el número de dimensiones.

    When we define instances we define them similarly to how you might spec out a server
    Optimize on a number of dimensions
    When we talk about families these are the drivers

    EC2 has a broad selection of instance types to satisfy the resource needs of a diversity of workloads.
    Our instance families are logical groupings of instances, and you can see each has a different focus
    For example, compute optimized instances have a higher balance of CPU power and offer the best price for compute performance
    Memory optimized instances have a higher balance of memory and offer the best price per GB of RAM
    And you can see where I’m going with storage optimized, which offers the best value for either IO performance or per GB of instance storage

    Things have changed since we first started up EC2 back in 2006, when we launched the m1.small instance. It’s CPU was specified as a performance measure, the ECU. We now provide a lot more transparency. For example, you know the model number, base clock frequency, and turbo of the processor underlying a c3.large

  • This is all reflected in our API name, but we haven’t really called it out this way before.
    Quick review since these terms will come up often in the remainder of the presentaiton

    Within each family are generations
    You’ll see listed at the top of each family the current generation, for example C3 in compute optimized and R3 in memory optimized
    Within each generation or instance type, we offer multiple sizes
    Each size within a generation has a similar balance of resources, so each C3 size has a similar ratio of compute, memory, and storage
    Each size is typically 2x the resources and 2x the price of the next smallest size, so for example a c3.2xlarge has twice the resources of a c3.xlarge and is 2x the price
    You can pick the size that meets the needs of your workload


  • Evolucion en virtualización x86
    Lo que hemos hecho +performance – jitter, OS flexibilities.
    El hipervisor tiene que interceptar cualquier instrucción que haga um cambio sobre el sistema.
    Antes de VT-x (Tecnología de virtualización assistida por hardware)
    Escanear la instrucción y traduccion binaria. –Perfor +Sin cambiar el guest OS
    Ignorar y usar hypercalls para reemplazarlas. -Requiere modificación del OS del guest (PV)
    VTX – nuevo modo de ejecución de CPU.
    No tiene perdida de perf y no requ modif. El OS del guest. (HVM)
    T2, R3, I2, C4 solo HVM
    Opciones de scheduling.
    Cuando el hipervisor asigna según necesidad vCPUs basado en el CPU físico, esto resulta en variabilidad de recursos de CPU asignados.
    Creamos controles como asignación directa de puertos para mantener la consistencia que es lo más importante para nosotros.


    Going to talk about some industry trends in virtualization, which is important background for understanding some of the things Anthony will dive into

    A lot of what we have done over the years relates to the challenges of virtualization – increasing performance, reducing jitter, and providing operating system flexibility.
    The hypervisor must be able to trap any instruction that changes the hardware or state of the system. This is to provide isolation between virtual machines.
    Before Inten VT-x, there were 17 instructions in x86 instruction set that don’t have this property. So you have a couple options
    So you can scan the instruction stream of each virtual machine for privileged instructions and do binary translation – performance is not ideal
    Ignore those instructions and provide “hypercalls” to replace instructions that lose their functionality – modified OS Kernel, compatibility and portability
    Use hardware assisted virtualization technology provide a new CPU execution mode feature that allows the hypervisor to run in a new root mode below ring 0.
    The hypervisor also provides hypercall interfaces for other critical kernel operations such as memory management, interrupt handling and time keeping.
    When virtualizing the CPU, one also has a choices of how to assign physical CPU cores to virtual CPUs.


  • Tendendencias de virtualizacion.
    Lo que hemos hecho +performance – jitter, OS flexibilities.
    Nuestro hipervisor debe interceptar cualquier instrucción que cambie el estado del hardware para aislar.
    Antes de VT-x habia 17 instrucciones que no lograban hacer esto.
    Escanear la instrucción y traduccion binaria. –Perfor
    Ignorar y usar hypercalls para reemplazarlas. Requiere modificacion de kernel
    VTX permite al hipervisor tener más privilégios usando hardware assisted virtualization.
    Cuando se virtualiza cpu se debe escoger bien como hacerlo para mantener la independência
  • También debemos mantener el performance consistente en términos de IO y acceso a dispositivos.
    El reto es hacer el agendamento de los IO requiest entre los dispositivos virtuales y físicos.
    Tradicionalmente se usa um modelo de driver dividido. Uma parte em el host OS y outra em el guest OS. – Genera variabilidade. – Uso de recursos de host.
    Uma opcion es hacer um pass through del dispositivo directo a la VM. + No usa recursos – Es peligroso al ser multi tenant
    Intel VT-d que dejar hacer pass throug a travez de um IO memory management unit y logra hacer memory address translation com page tables.


    Drivers consistentes entre dispositivos entrega mejor portabilidad entre diferentes HW.
    El principal reto assignar memoria permitiendo el OS usar diretamente. Seguridad!
    IOMMU puede identificar la fuente y puede rechazar accesos. Tiene tablas para manejar espacios
    Se usa para Memoria, isntancias GPU, drivers PCI

    Consistent device drivers provided in a split driver model allows for better portability of machine images across hardware generations. Allows hardware specific drivers to reside in a control operating system, and simple front-end driver in the guest communicates to the back-end through ring buffers in shared memory pages. The multiplexing happens on the host, and it can require host CPU resoruces.
    The original challenge of assigning a device to a virtual machine has to with direct memory access, so a device can modify memory without bothering the CPU. That would be a serious security hole if allowed in the context of a multi-tenant host.
    IOMMU can identify source devices and either deny or translate memory requests using IOMMU page tables. This enables the hypervisor to assign specific devices to a guest and restrict device memory access to pages owned by the guest. This is how we enable PCI-passthrough for things like GPU instances and SR-IOV network devices.


  • Lo logramos por la escala que tenemos
    Objetico de eliminar trade offs.


    With our scale we’re able to bring things to customers which might not otherwise come as quickly
    Much of our investment in the EC2 Platform has been to tackle one or more of these virtualization challenges, eliminate tradeoffs
  • Les voy a mostrar como obtener el máximo com su experiência.
  • T2:
    Las de más bajo costo
    Perfecta para um uso general.
  • Muy baja latência de acceso al disco

    Para obtener esto se require um tunning
  • Corta explicación de instance store
  • Use este kernel o superior
  • Les voy a explicar por que es esta la recomendacion
    Cada vez que la instancia iba a hace i/o, se decide ler a esta posicion em memoria
    Instancias no tiene acceso directo a sus ssd
    Tenemos um I/O Domain
    Por defecto el i/o domain no tiene acceso a la memoria. La instancia tiene que darlo
    Es rápido para grandes cantaidades de datos
    Requiere TLB flush por operación. Es muy costosos
  • Se pre aprueba acceso a um pull de bloques de memoria
    Procesadores nuevos son muy Buenos haciendo copias de datos, hasta doblar el IO performance.
    Igual com kernel anterior funcionan bien si la necesidad es solo latência y no cant de io
  • Se debe usar o no trim?
    Operación solo para SSD. Depende de la ami pero se obtienen excelentes resultados al Hacer periódica uma vez por semana o por dia, Windows no soporta trim
    Si no hay trim, se reserva el 10% del disco y nunca se usa. Mismo efecto
  • Por qué es importante:
    Los SSD son muy sofisticados. La tecnologia de FLASH se degrada com cada escrita. Sectores de disco
    Despues de millones de escritas, para de funcionar.
    Uma DB podria re escribir logs de transaciones. Si se realiza esto em el mismo sector, llegaran mas temprano al final de la vida.
    SSD Wear leveling. Trim y Overprovisionan disminuyen el garbage collection.
  • Para explicar um poco mas a fondo.
    Anillo.
    Todas las escritas son random.
    Hace que se gaste el anillo.
  • Van a llegar al final del anillo.
    Habrá espacios libres.
    Mover bloques para liberar espacio cerca de la cosla.
    Trim va a guardar donde hay espacios, lo que acelera las escritas de forma más dinâmica.
    Tim o no Trim puede hasta cuadruplicar sis i/os
  • Enh Networking les dará la máxima capacidade de performance de red posible em EC2
  • Usen HVM. Se ve um gran performance imprivement.
  • Bare metal tiene kernel mode o application / user mode. Es muy rápido gracias a intel.
    Com PV el hipervisor media comunicaciones entre el kernel y el app. Esto requiere TLB flushes tambien
    Para algunas aplicaciones no habrá diferencia. Si es mucho io / muchos paquetes en la red
  • Ultimo consejo
    Usen TSC –time stamp conter como clocksource.
  • Puerbas automatizadas.
    TSC hardware clock source. Em Linux se puede hablar com tsc sin el kernel.
  • Si
  • Take yourself back to 2006, for the EC2 beta program. We offered one instance size – the m1.small. It has less than 2 GiB of memory and a virtual CPU
    We knew that one size doesn’t fit all workloads, and over time we invested in a platform to help us accelerate bringing more EC2 instance selection to customers
    When you own the hardware and rent it, rather than sell it, everything changes. We understand much more intimately how customers use the hardware, and we become obsessed with total cost of ownership.
    The selection of instances has grown, now reaching 44 instances. And over the past 2 years we’ve grown disproportionately compared to previous years.
    What’s enabled us to do this and how do we make sense of the options?

    The EC2 platform is the engine that allows us to produce new instance sizes quickly to meet the needs of different workload segments
    It’s the hardware and the hypervisor depicted a couple slides ago, it’s the EC2 control plane, and it’s also a procurement and supply chain teams, and datacenter operations teams
    Lot’s of technologies, teams, and processes tat make up the EC2 platform.
    With the platform we’re able to ingest new technologies to do one of two things, either create a new instance family to address a different market segment, or bring forward a new generation which serves an existing segment with more performance, new feature, and or lower prices.
    As technology improves, we want to ensure customer are able to benefit from improvements in CPU, SSD, and other components. We do this through our current generation instance types.

×