-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
performance issues #37
Comments
Perhaps that's because it's making a new connection to mongo on each udp received. class Collector(DatagramProtocol):
On 2012-05-29, at 1:23 PM, James Jones wrote:
Ship, ahoy! Hast seen the White Whale?
|
Sounds like a plan will try that. |
Pleas take a look at the code below. This was my best guess. I am sure I am doing something wrong here but switching from pymongo to txmongo has caused a 95% decrease in performance. I am wondering if there is way to use the txmongo.MonoConnection object global so I only need to connect to mongo once. Sorry I am still a bit of a noob to python, twisted and mongo. but basic idea is store udp packet for later processing.
from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor,defer
import txmongo
import struct
import string
x = 0
class Collector(DatagramProtocol):
def init(self):
print "Initializing Collector";
reactor.listenUDP(2055, Collector())
print "Starting Reactor"
reactor.run()
print "Packet Count: ", x
The text was updated successfully, but these errors were encountered: