Danylo
Danylo3w ago

right but I mean convex vs in memory

right but I mean convex vs in memory implementation
17 Replies
wes
wes3w ago
probably makes sense to move this into a thread what is your main concern? the cost?
Danylo
DanyloOP3w ago
We’ve built a platform where we launched a PvP game — players basically try to jailbreak an LLM and can see their opponent’s chat in real time. Right now, it’s built on top of WebSockets and Redis, but Convex could give us a whole new level of robustness. The question is whether it would still be cost-effective if we scale to around 100–200 concurrent users, with peak usage spikes up to 3–5k.
wes
wes3w ago
i'm assuming this is a free to play thing?
Danylo
DanyloOP3w ago
yeah I mean we are ok paying some amount of money but reasonably couple hundred tops
wes
wes3w ago
just based on the prices i don't see you going much over what the pro plan covers tbh
wes
wes3w ago
you can run some tests with it then check your usage in the admin panel to do some rough math
No description
Danylo
DanyloOP3w ago
I mean update per socond would be 2.5 mil a month so 100 concurent is like 250 mil no ?
wes
wes3w ago
with absolutely no optimizations it could be a lot yes, but ideally something like this should be optimized for reducing calls
Danylo
DanyloOP3w ago
How can I do that ? I would love some suggestions !
wes
wes3w ago
well in that component you can limit the amount of mutations/queries that the chunk appender triggers like by sentence instead of by token or something.
Danylo
DanyloOP3w ago
right right
wes
wes3w ago
that's really the only bottleneck is how often the chunk appender is running
Danylo
DanyloOP3w ago
Hey, one more question — if, in each game, users are chatting with the LLM, does that mean each user is creating a separate HTTP connection? Would that limit me to 128 concurrent connections? Thanks again for all your help!
wes
wes3w ago
with this component yes i think so. if you wanna just use queries for everybody, the agent component is really good there’s a chance for your specific scenario convex might not be the best fit though if you expect to actually have 1000s of concurrent requests for a game that is free and realtime. i can’t remember, but may have read in the docs somewhere that realtime gaming type stuff isn’t really the ideal use case.
Danylo
DanyloOP3w ago
ok thank you I still think we can make it work with some optimizations and compromises The value is massive Do you know by chance how does t3 chat do streaming to so many users ?
wes
wes3w ago
they are primarily streaming to a single user instead of mirroring. so by default most of the usage would be through the http action sse stream. which is a single function call. it’s the mutations/queries that could get heavy when mirroring the stream to a second person that didn’t initiate the call
Danylo
DanyloOP3w ago
So if we save only one message end, wouldn't we still tun into 128 concurrent http actions? because thats a compromise we're willing to make save once or twice a message

Did you find this page helpful?