boqapt
boqapt

Reputation: 1776

How can I set ZeroMQ swap files location for pyzmq?

I am using django and pyzmq, also ZeroMQ PUB and SUB sockets with configured HWM (high watermark) and disk SWAP. ZeroMQ creates it's swap files (like zmq_10976_0.swap) inside the root directory of django site. Process which use ZeroMQ is created by django action so I assume that swap files are simply placed to the current directory. How can I tell it to put these files somewhere else? I don't want to change current directory for the whole process for that.

Upvotes: 0

Views: 500

Answers (1)

Michael Dillon
Michael Dillon

Reputation: 32392

If you look in https://github.com/zeromq/zeromq2-2/blob/master/src/swap.cpp you can see that the filename does not specify a directory path, therefore it will go wherever the current directory is pointing to. It would be pretty easy to modify that and build your own zmq library using RPATH to bundle libzmq into the pyzmq module directory. You would then have your own local customized pyzmq package.

Upvotes: 1

Related Questions