Graham C10M talk at Shmoocon 2013

This video was mentioned on highscalability.com, so I thought I’d have a look. Knowning this stuff is useful when you’re in the business of delivering large amounts of geographical data to a large amount of clients.

C10M = 10 million concurrent requests.

In short the video is about getting a server to handle 10 million concurrent requests, and how the problem isn’t hardware. It’s software (e.g. Apache, UNIX etc).

Discussions related to the video:

A C program shown in the talk:

#include <stdio.h>
 
int main()
{
    char *ip1 = "10.1.2.3";
    unsigned char ip2[] = {0xA, 0x1, 0x2, 0x3};
    int ip3 = 0x0A010203;
 
    int ip4 = *(int*)ip2;
 
    printf("ip3 = %x\n", ip3);
    printf("ip4 = %x\n", ip4);
    return 0;
}

Some take aways (Roberts take-aways at 44m40s):

  • The kernel is not the solution. It is the problem
  • Google “lock free” data structures
  • You can configure Linux so use only a fixed subset of the processors in multi-core: maxcpus=2 (boot param to make Linux only use the first two cores), i.e. you own the rest.
  • You can configure which core your thread should run on: pthread_setaffinity_np()
  • You can configure which cores handles which interrupts: /proc/irq/smp_affinity
  • Following a pointer => cache miss. In a high scalability network server there is budget for four cache misses (300 clock cycles per miss). This means, colocate data in a contiguous memory data structure

Leave a Reply