ConnectionError: (-10L, 'Socket read error: 104, :3000, 35382', 'src/main/aerospike/as_socket.c', 248, False)

It seems you are using a scan (primary index query) to only select records for a particular set. This can be slow if the namespace is large (see this article: FAQ - Scans in Aerospike and specifically the set index part). You may also want to check on operation background scans to avoid having each record returned to the client. I am not an expert on those but I am pretty sure this can be done in one shot from the client with the right expression and the server will do it fully in the background. If you have an index on the set, it should be as fast as the storage can take on the database. Here is the doc on Expressions.