crypto:rand_bytes(4) in wsock_framing:apply_options/2 could be a bottleneck if you have a high load because it contains some kind of rwlocks inside
Thread 4 (Thread 0x7f76f94e1700 (LWP 4202)):
#0 syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1 0x00000000005d65f9 in wait__ (spincount=spincount@entry=1990, e=e@entry=0x7f7717840bd0) at pthread/ethr_event.c:92
#2 ethr_event_swait (e=e@entry=0x7f7717840bd0, spincount=spincount@entry=1990) at pthread/ethr_event.c:224
#3 0x00000000005d3f5b in event_wait (mtxb=mtxb@entry=0x7f7718a45708, tse=tse@entry=0x7f7717840bc0, spincount=1990, type=type@entry=1073741824,
is_freq_read=is_freq_read@entry=0, is_rwmtx=1) at common/ethr_mutex.c:574
#4 0x00000000005d5966 in write_lock_wait (is_rwmtx=1, is_freq_read=0, initial=<optimized out>, mtxb=0x7f7718a45708) at common/ethr_mutex.c:706
#5 rwmutex_normal_rwlock_wait (initial=<optimized out>, rwmtx=0x7f7718a45708) at common/ethr_mutex.c:2307
#6 ethr_rwmutex_rwlock (rwmtx=0x7f7718a45708) at common/ethr_mutex.c:3005
#7 0x00007f76f4bac430 in ssleay_rand_bytes (buf=0x7f74fba89058 "\252J\250\373t\177", num=4, pseudo=1, lock=1) at md_rand.c:386
#8 0x00007f76f4eb8009 in rand_bytes_1 (env=0x7f76f94e0e20, argc=<optimized out>, argv=<optimized out>) at crypto.c:1775
#9 0x00000000005631ee in process_main () at beam/beam_emu.c:3525
#10 0x000000000049c4b2 in sched_thread_func (vesdp=0x7f77104f1340) at beam/erl_process.c:7695
#11 0x00000000005d5ef5 in thr_wrapper (vtwd=0x7ffdec92fed0) at pthread/ethread.c:106
#12 0x00007f771e803df3 in start_thread (arg=0x7f76f94e1700) at pthread_create.c:308
#13 0x00007f771e3291ad in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
crypto:rand_bytes(4) in wsock_framing:apply_options/2 could be a bottleneck if you have a high load because it contains some kind of rwlocks inside
most threads on my server wait for this lock, like this: