Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto:rand_bytes(4) could be a bottleneck #11

Open
timofey-barmin opened this issue Aug 11, 2015 · 0 comments
Open

crypto:rand_bytes(4) could be a bottleneck #11

timofey-barmin opened this issue Aug 11, 2015 · 0 comments

Comments

@timofey-barmin
Copy link

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:

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant