-
Notifications
You must be signed in to change notification settings - Fork 16
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
dispatchEventQueue #50
Comments
Timeout in |
CPU usage doesn't change but memory footage keeps growing when data volume surges. I do additional low-latency processing for each update. However, I was measuring time for dispatchEventQueue alone and it was taking a very long time. |
Would you be able to try below PyRFA configuration for higher data volume? Change
|
Thank you. I'll try them when the market opens again. |
It should be “Dual” in this case. |
I tried your suggestion. Unfortunately, I still see the same problem. I even removed all my local processing except counting the number of updates. I see the slowdown less immediately but after a couple of hours, it came back and seems to be stuck. It is very strange. |
Are you able to share your code and your server specs e.g. RAM and CPU. |
I can't but I can say RAM and CPU should never be a bounding factor, especially because I do the same job written in a traditional RFA API (c++, java) without a problem. The number of symbols I subscribe to is between 3k and 5k. |
Could there be any other connection configs I can play with? Thank you very much for the help. |
Now, below is basically what I did other than occasional print which I didn't show below. So I'm doing almost nothing other than dispatching.
|
Can you change to use while True:
time.sleep(0.005)
updates = cns.dispatchEventQueue()
... |
It's interesting. That actually reduced the dispatch time by an order of magnitude. I'm wondering, whether dispatchEventQueue is not fast enough to handle the volume when tick data surges, especially because it creates a python list of dictionary from field updates. |
One thing that dispatchEventQueue does is to keep dispatching until no more updates in queue before returning tuples to Python. We will look into it. |
Thanks. That sounds like a very likely cause. |
When market data volume peaks, dispatchEventQueue doesn't return for a very long time (at least a minute or more), and then I see the memory footage of the application keeps growing.
I tried giving no timeout, or setting timeout=1, and both showed the same issue.
I'm testing with US stock market and it's been happening near market close when the data volume is high.
Has anyone experienced a similar problem?
The text was updated successfully, but these errors were encountered: