[strongSwan] Using multiple UDP sockets with SO_REUSEPORT option to increase high connection rate

Chinmaya Dwibedy ckdwibedy at yahoo.com
Fri Mar 21 15:23:31 CET 2014


Hi,
 
The struct receiver_t receives packets from the socket, performs
light-weight parsing and adds them to the job queue. The receiver starts a
thread, which reads on the blocking socket. A received packet is preparsed and
a process_message_job is queued in the job queue. The processor picks a job
from the Jobqueue and assigns the job to a thread. The thread then performs the
job.  I think, The IKE responder reading
in a dedicated thread but writes (send) can come from several different threads.
And the single receiver thread becomes bottleneck due to high connection
rate/setup rate.  Now I have 15
additional cores which are underutilized, which i would like to use. Can it
possible to create separate UDP sockets for each thread?
The SO_REUSEPORT socket option allows multiple UDP sockets to
be bound to the same port. With SO_REUSEPORT, multiple threads could use recvfrom
() on its own socket to accept datagrams arriving on the port.  I think, it distributes datagrams evenly
across all of the receiving threads, that can lead to utmost utilization of CPU cores. 
Please feel free to suggest if I am wrong.
 
Regards,
Chinmaya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strongswan.org/pipermail/users/attachments/20140321/c0824533/attachment.html>


More information about the Users mailing list