You cannot run very large pipelines if you read the output only at the end.
Otherwise memory will accumulate in communication buffers until Redis
decides that the buffer is too big and close the connection.
It is unrelated to the memory allocated to the server.
Ideally, you should read the first replies as soon as possible, but since you
use the synchronous API it is not convenient. The easy way to fix it is
to loop on batches of n items (for instance n=1000). Instead of running
1 roundtrip of 30K, try to run 30 roundtrips of 1K.
Regards,
Didier.