- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We typically have 1M+ users online per instance. In our current implementation, we queue pending messages for user in a lock-free linked list.
We are planning to change that implementation using concurrent_queue where a queue is assigned to users having pending messages. However, this will result in worst case scenario having 1M queues (thought this can be reduced by queue pool later).
Hence, was wondering about per queue overhead. Feel free to suggest other alternatives.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I do not know the exact amount of memory consumed by empty tbb::concurrent_queue but the rough estimation can be as a size of its representation. concurrent_queue_rep_base is about 3 times of NFS_MaxLineSize number of bytes (that is 128) and 8 sizes of micro_queue that is about 5 pointers each. The total is about 700 bytes so we can say that overall estimation is not bigger than 1K. Therefore, 1M+ queues will consume 1Gb+ memory. Pay attention that this estimation is rough and valid only for some particular version of the implementation.
Regards,
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Alex!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page