Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4080712
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:57:55+00:00 2026-05-20T17:57:55+00:00

I’m working on a project which uses Twisted to provide a high performance UDP

  • 0

I’m working on a project which uses Twisted to provide a high performance UDP server capable of handling burst traffic of 5k packets / second, with packet ranging in size from 50 to 100 bytes. The PC I’m testing the server on has a quad-core CPU with 4GB RAM and is running Ubuntu 10.1.

In my performance tests, I’m using tcpreplay to send previously captured traffic consisting of 500 UDP packets to the Twisted UDP server as fast as possible. The tests are between two physical (non-VM) machines on the same gigabit LAN. According to tcpreplay, I’m sending the packets at ~1250 packets / second, but out of the 500 packets that I’ve sent, only ~350-400 packets are received by the Twisted UDP server.

What kind of performance tuning can I do in Twisted or on a system level to boost performance and prevent too many dropped UDP packets?

Server Code

#!/usr/bin/env python

from twisted.internet import reactor
from twisted.internet.protocol import DatagramProtocol

packetCount = 0

class DeviceProtocol(DatagramProtocol):

    "Show me how many packets the server has received"
    def datagramReceived(self, datagram, address):
        global packetCount
        packetCount += 1
        print "Received packet %s" % packetCount

def main():
    reactor.listenUDP(7000, DeviceProtocol())
    reactor.run()

if __name__ == '__main__':
    main()

Custom Sysctl.conf Settings

net.core.netdev_max_backlog=2500
net.core.rmem_max=16777216
net.core.wmem_max=16777216

Updated Answers

  • CPU Usage never goes above 10%
  • Redirecting the output to a file, or only printing every 100th “Received packet” message makes a small difference, I’m still seeing 10-20% dropped packets.
  • Tested that my network is stable and performs well using iptraf
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T17:57:56+00:00Added an answer on May 20, 2026 at 5:57 pm

    I’ve tested my network using iperf, which is an excellent tool that I’ll be adding to my toolbox, and my network handles all of the traffic without issue.

    It turns out my issues were due to:

    • Using a small capture file
    • Replaying the capture using tcpreplay’s –loop option

    In my tests, tcpreplay drops packets if it loops too quickly over a small capture file. My capture file consisted of 100 packets, and looping over it four or five times would cause 10-20% of the packets to not be sent to the receiving side.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I want use html5's new tag to play a wav file (currently only supported
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.