From: "Iñaki Baz Castillo" <ibc@aliax.net>
To: ruby.posix.mq@librelist.com
Subject: Re: Calculating the required value of "ulimit -q"
Date: Mon, 18 Jan 2010 17:09:10 +0100 [thread overview]
Message-ID: <201001181709.10645.ibc@aliax.net> (raw)
In-Reply-To: 201001181305.24538.ibc@aliax.net
El Lunes, 18 de Enero de 2010, Iñaki Baz Castillo escribió:
> I'm using the mqueue as queue system, rather than just a inter-processes
> communication method. So in case the remote SIP server fails (or TCP
> connection) then que mqueue queues the messages.
>
> There is other approach I'm working right now: use a normal mqueue
> (msgsize 20-50) and the reader process inserts the message in an Array.
> Other thread in same process reads from the Array and sends the message
> via TCP/SIP.
>
> Un this case, the mqueue is just used for inter-process communication and
> the Array as a queue. I still must do some benchmarks to compare both
> approachs.
Ok, more or less solved:
I've coded a queue based on an Array of fixed length (5000 entries as max
size). When a message is extracted from the mqueue is appended to the Array.
When the corresponding SIP message is sent (by other thread) such entry is
shifted from the Array.
I get same performance than using Posix mqueue as queue, but now the mqueue
just requires maxmsg=100 which is much less than 5000 :)
--
Iñaki Baz Castillo <ibc@aliax.net>
prev parent reply other threads:[~2010-01-18 16:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-14 22:33 Calculating the required value of "ulimit -q" Iñaki Baz Castillo
2010-01-14 22:55 ` Eric Wong
2010-01-14 22:57 ` Iñaki Baz Castillo
2010-01-14 23:01 ` Iñaki Baz Castillo
2010-01-15 10:01 ` Iñaki Baz Castillo
2010-01-15 18:33 ` Iñaki Baz Castillo
2010-01-15 20:15 ` Eric Wong
2010-01-15 21:27 ` Iñaki Baz Castillo
2010-01-15 22:12 ` Eric Wong
2010-01-15 23:41 ` Iñaki Baz Castillo
2010-01-16 1:02 ` Eric Wong
2010-01-16 13:08 ` Iñaki Baz Castillo
2010-01-18 11:35 ` Eric Wong
2010-01-18 12:05 ` Iñaki Baz Castillo
2010-01-18 15:42 ` Iñaki Baz Castillo
2010-01-18 15:55 ` Iñaki Baz Castillo
2010-01-19 2:59 ` Eric Wong
2010-01-19 9:29 ` Iñaki Baz Castillo
2010-01-18 16:09 ` Iñaki Baz Castillo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://yhbt.net/ruby_posix_mq/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201001181709.10645.ibc@aliax.net \
--to=ibc@aliax.net \
--cc=ruby.posix.mq@librelist.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhbt.net/ruby_posix_mq.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).