Re: Threads, Sockets and OSX

Nicola Mingotti <[email protected]>
Newsgroups gmane.comp.lang.ruby.general
Message-ID <[email protected]>
Hi Peter,

I am writing an application that must run on a Linux server where i 
can't install what i want.
I am developing it under FreeBSD, my machine, where i am free to install 
stuff.

I observed important differences in the performance (and bugs) of the 
app running on the server with an old Ruby
and on my machine with a recent Ruby.

So, the first thing you may check is: are the two Ruby version the same ?
Preinstalled versions of Ruby tend to be VERY old.

After a while, to ensure the same behaviour on different OSes I moved 
the app to JRuby.

Now it is all very consistent, I am happy with that.

You may try JRuby as well, it is trivial to get it working provided you 
have
a recent (1.8) version of Java installed. You don't need root.


bye
n.





On 12/5/18 11:33 AM, Peter Hickman wrote:
> 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?
>
>
> Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>


Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.