Speeding up your small crypto operations

It is known that libumem will give you performance boost over the default solaris memory allocator. This cannot be underscored enough with small data sizes when it comes to Niagara (T1000/T2000) machines.

When using the Cryptographic Framework either directly or plugged into something like NSS, small crypto operations can bog down your machine because the memory allocation locking which will block other operations. Using libumem, it relieves the load on the allocation locks. When using a T1000, reporting 24 cpus, with each cpu doing a small operation continuously with SHA1 or AES. There is a very noticeable problem.

SHA1 with 16 byte data size
Memory allocator:libc.solibumem.so
Avg Time per Operation:29040 nsec20803 nsec
Operations per second:3442448070
CPU idle time:41%0%

SHA1 with 256 byte data size
Memory allocator:libc.solibumem.so
Avg Time per Operation:127245 nsec52903 nsec
Operations per second:785918903
CPU idle time:0%0%

AES with 16 byte data size
Memory allocator:libc.solibumem.so
Avg Time per Operation:67035 nsec35353 nsec
Operations per second:1491728285
CPU idle time:55%0%

AES with 256 byte data size
Memory allocator:libc.solibumem.so
Avg Time per Operation:186246 nsec165087 nsec
Operations per second:53696057
CPU idle time:0%0%

Igorning the performance gains, note the cpu utilization for 16 byte operations. Using the default memory allocator, 41% and 55% of the cpu time was idle, that is nearly 10 and 13 cpus worth of power sitting on the sidelines doing nothing.

Looking at the 256 and 512 byte data file, the malloc locking does not cause any idle time, but it reduces the performance. By the time you get over 1024 bytes the locking is less of a problem as the crypto algorithms are taking most of the operation time and the locks are colliding less.

In the end, this can give you an overall performance boost with SSL because many transactions are small one. You should see better performance with your web servers and directory servers. Many web server transactions, particularly from the clients have small in size; as well as, most the directory server/ldap transactions.

Make sure you are using libumem. The easiest way is the preload the library:

    # LD_PRELOAD=/usr/lib/libumem.so.1; export LD_PRELOAD
    # LD_PRELOAD_64=/usr/lib/libumem.so.1; export LD_PRELOAD_64
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

izick

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today