Peter Hickman
2018-12-05 19:33:53 UTC
I have a little app that is basically the standard threaded TCPServer with
a couple of mutexes to implement a fifo queue. When it runs it goes flat
out for 15-20 seconds and then freezes for 10-15 seconds. Everything
resumes just fine but it's a bit annoying and occasionally the freeze lasts
long enough to timeout connections to the server
My first thought was the GC was kicking in and so I have been trying to
find ways to reduce the amount of GC that needs to be done as well as
calling it when I have created or deleted structures so that it does not
accumulate a pile of work and kick in unexpectedly
This has reduced the number of times that the timeout causing freezes have
happened but not affected the other freezes and has also reduced the
throughput
This is on a MacMini with 4 CPUs and 8 GB ram
After much fiddling with data structures and the like I just decided to run
this on a Debian box with 4 CPUs and 4 GB of ram
No freezes whatsoever! Not even a little one. Throughput jumps from 500-700
puts/gets per second to 1,000 to 1,500
Where is the problem with OSX
1) Threads
2) Sockets
3) Mutexes
Anyone seen something like this before?
a couple of mutexes to implement a fifo queue. When it runs it goes flat
out for 15-20 seconds and then freezes for 10-15 seconds. Everything
resumes just fine but it's a bit annoying and occasionally the freeze lasts
long enough to timeout connections to the server
My first thought was the GC was kicking in and so I have been trying to
find ways to reduce the amount of GC that needs to be done as well as
calling it when I have created or deleted structures so that it does not
accumulate a pile of work and kick in unexpectedly
This has reduced the number of times that the timeout causing freezes have
happened but not affected the other freezes and has also reduced the
throughput
This is on a MacMini with 4 CPUs and 8 GB ram
After much fiddling with data structures and the like I just decided to run
this on a Debian box with 4 CPUs and 4 GB of ram
No freezes whatsoever! Not even a little one. Throughput jumps from 500-700
puts/gets per second to 1,000 to 1,500
Where is the problem with OSX
1) Threads
2) Sockets
3) Mutexes
Anyone seen something like this before?