Speeding up IPC with Ruby

1.3k views Asked by At

I am trying to do IPC between 2 processes on the same Linux box in Ruby, and I need to optimize the solution as far as practicable.

I had begun with a TCPSocket but I see that using UNIXSocket is probably faster, and perhaps does not copy data to kernel buffers.

I have been reading SO threads, and looks like mmap might be interesting to look at. But for mmap I need to a) install mmap gem and b) provide locking since multiple client processes would likely try connect with the server process (both running on same box).

My questions:

  1. What other options would you recommend?
  2. How do you recommend locking the memory with ruby mmap?
  3. How do the numbers, if there's any available, stack up for UNIXSocket versus mmap?
0

There are 0 answers