Comments (10)
Sorry you're running into this! A minimal example would be great, but in the meantime, can you provide some details on how the producers/consumers are structured - eg, are these multiple threads in a single application?
from aws-sdk-ruby.
Yeah I'm sorry about not getting a minimal example up, we have found it difficult to produce one so far...
We currently have 8 active shards in the kinesis feed (4 were split) this is being processed by 4 ruby workers (individual processes running on different kubernetes pods) each consuming 2 shards. These workers are run on kubernetes with 2GB of RAM. This works fine until a burst of data comes through or the consumers slow down (even a little bit) at which point memory usage spikes and the pods get reaped.
from aws-sdk-ruby.
Yeah - creating examples for these is hard. I'm also working on trying to reproduce this...
How are you creating async clients on the workers? Are you sharing a single async client per worker?
Each async client should have a single H2::Connection, which should have only a single socket thread which is reading from the socket - and that thread is what runs any event handlers. So if your event handlers slow down, it should effectively slow down the reads from that socket.
How are you processing events? Can you provide any details?
from aws-sdk-ruby.
We spawn a thread for each shard (2 per worker). Within each of these threads we create an async client and subscribe that thread scoped AsyncClient to consume from 1 shard. We are processing each event as it arrives by passing a block to AsyncClient#subscribe_to_shard
.
each thread blocks using async_resp.wait
. When that wait step unblocks we allow the thread to die and create a new one.
We have played around with creating a single AsyncClient and passing it to each thread. That change did not stop our kubernetes pods being reaped with memory exceeding 2GB
from aws-sdk-ruby.
Thanks for description - that sounds pretty reasonable. I've been working on creating some similar small test case and was able to do a bit of memory profiling. I'm not 100% confident that this will fix your issue, but it does significantly reduce the number of large string allocations that are being done: #2834 and overall reduces the memory used (as long as you are not setting http_wire_log
to true
, which I assume you aren't for a production application....).
from aws-sdk-ruby.
@jpaulgs Are you seeing this issue again with the latest version of kinesis and aws-sdk-core 3.170.1?
from aws-sdk-ruby.
@mullermp we'll bump to using that version tomorrow but we are currently keeping up with records in prod so it'll take a little while to confirm.
from aws-sdk-ruby.
Thanks, just let us know. Re-open the ticket if it auto closes and it's still not resolved.
from aws-sdk-ruby.
This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.
from aws-sdk-ruby.
⚠️ COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
from aws-sdk-ruby.
Related Issues (20)
- [SES] Custom verification email template no redirect HOT 9
- SQS QueuePoller sometimes returns dupe messages, raises BatchEntryIdsNotDistinct HOT 1
- DynamoDB #query method returns response with items = nil HOT 18
- Aws::S3::PresignedPost does not support tagging field HOT 3
- Multipart copy for Glacier
- CognitoIdentityCredentials is not including the logins set when getting credentials, making all requests unauthenticated HOT 5
- `Aws::BedrockRuntime::Types::<X>` doesn't have `event_type=` HOT 3
- Listing shared RDS Clusters raises an ArgumentError HOT 6
- Errors downloading files from s3 are propagated to incorrect thread HOT 8
- aws-sdk-sqs raises NoMethodError when messages not found HOT 14
- Generate RBS HOT 15
- aws-partitions 1.856.0 no longer be found in that source HOT 8
- aws-sigv4/eventstream released a minor version bump after removing support for Ruby 2.3/2.4 HOT 5
- [aws-sdk-sqs] Aws::SQS::Types::SendMessageBatchResult#failed returns nil HOT 8
- aws-sdk-sesv2 API :next_token Symbol key literal doesn't work as expected (but String key does) HOT 4
- S3 Control Client - Unable to Parse URI HOT 6
- AWS Bedrock ReadTimeout NetworkingError TCPSocket closed HOT 3
- Tagging resources seems to be broken HOT 6
- Aws::Errors::MissingCredentialsError exception in ECS when using TaskRoleArn HOT 10
- Gem displays deprecation warning in ruby 3.3 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-sdk-ruby.