question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use batching/chunking timers

See original GitHub issue

There are multiple places within Autobahn (at the WebSocket and at the WAMP level) where we use timers sticked to protocol instances.

When running massive numbers of connections, this can lead to significant CPU load.

Since these timers don’t need to be precise, and hence we can conserve CPU by batching timeouts into buckets (and process timeout callbacks within a bucket in chunks).

The underlying functionality will be in txaio: https://github.com/crossbario/txaio/issues/66

Once that is done, we should use them here.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:25 (25 by maintainers)

github_iconTop GitHub Comments

1reaction
meejahcommented, Apr 22, 2016

With the changes from https://github.com/crossbario/txaio/pull/67 I hacked together some quick numbers after replacing all the call_laters in websocket stuff to batched timeouts.

This is just a local test on an 8-core machine, ramping up to 20k do-nothing websocket connections (in one client process) with 10s auto-pings and 60s ping-timeouts enabled and then idling for a while. I’m showing the CPU usage of the server process as grok’d by collectl every second (there’s almost no green impulses in the latter part of the graph because the CPU usage is very low).

Conclusion: well worth the batching optimization. I will do a few more tests tomorrow playing with some of the batching parameters (this was 5s bucket size, chunked at 1000 per yield). The high CPU usage on the left is during the ramp-up phase…

batching

0reactions
oberstetcommented, May 1, 2016

@meejah alright, all of this is released in https://pypi.python.org/pypi/autobahn/0.14.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sending records in batches
Whether you're using the API or Algolia dashboard, it's best to send several records at a time instead of pushing them one by...
Read more >
Programming Your Mechanical Timer - YouTube
Mechanical timers offer simple scheduling of lamps, holiday decorations, small appliances and more. Shop mechanical timers at ...
Read more >
How to Get Motivated, Stay Organized, Time Block, Prioritize ...
587: Make Time for What's Important: How to Get Motivated, Stay Organized, Time Block, ... Google Calendar; Set work hours; Time blocking: batching/chunking....
Read more >
Context switching costs more than we give it credit for
It's because you want to use all the mental capacity at that time. ... I cannot write code and listen to music at...
Read more >
Invoke-Sqlcmd results to Export-Csv set batch row limit ...
Another alterantive would maybe to use the .net method system.array.copy ... Unfortunately, as of PowerShell 7.0, there is no batching (chunking) mechanism ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found