zeromq

Limiting queue length with PyZMQ

ぐ巨炮叔叔 提交于 2019-11-30 05:39:27
问题 I want to limit the amount of memory consumed by my ZeroMQ message queues in a Python application. I know that setting the high-water mark will limit the amount that will be queued on the sender side, but is there a way to control how much will be queued on the receiver side? The Python ZeroMQ binding seems to have it set at unlimited. My test scenario: I have two python terminals that I am using for testing. One is the receiver: Python 2.5.1 (r251:54863, Aug 25 2008, 20:50:04) [GCC 4.1.2

Why do operating systems limit file descriptors?

半城伤御伤魂 提交于 2019-11-30 04:51:23
I ask this question after trying my best to research the best way to implement a message queue server. Why do operating systems put limits on the number of open file descriptors a process and the global system can have? My current server implementation uses zeromq, and opens a subscriber socket for each connected websocket client. Obviously that single process is only going to be able to handle clients to the limit of the fds. When I research the topic I find lots of info on how to raise system limits to levels as high as 64k fds but it never mentions how it affects system performance and why

Compile simple hello world ZeroMQ C example, compile flags?

不打扰是莪最后的温柔 提交于 2019-11-30 02:33:20
Trying to compile the example hello_world.c from the zeromq tutorial: http://zguide.zeromq.org/page:all#Ask-and-Ye-Shall-Receive Pretty sure I have everything installed in OSX Mountain Lion. clang -Wall hwserver.c -o hwserver gives me an error: Undefined symbols for architecture x86_64: "_zmq_bind", referenced from: _main in hwserver-OgrEe6.o "_zmq_ctx_new", referenced from: _main in hwserver-OgrEe6.o "_zmq_msg_close", referenced from: _main in hwserver-OgrEe6.o "_zmq_msg_data", referenced from: _main in hwserver-OgrEe6.o "_zmq_msg_init", referenced from: _main in hwserver-OgrEe6.o "_zmq_msg

0MQ: How to use ZeroMQ in a threadsafe manner?

心已入冬 提交于 2019-11-29 22:29:56
I read the ZeroMq guide and I stumbled upon the following: You MUST NOT share ØMQ sockets between threads. ØMQ sockets are not threadsafe. Technically it's possible to do this, but it demands semaphores, locks, or mutexes. This will make your application slow and fragile. The only place where it's remotely sane to share sockets between threads are in language bindings that need to do magic like garbage collection on sockets. and later on: Remember: Do not use or close sockets except in the thread that created them. I also understood that the ZeroMQ Context is threadsafe. If a class registers

zmq vs redis for pub-sub pattern

…衆ロ難τιáo~ 提交于 2019-11-29 22:21:24
redis supports pub-sub zmq also supports pub-sub via a message broker What would be the architectural pros\cons for choosing between them? I'm aiming at points which are beyond the obvious use-case specific performance benchmarking that should be done (here's a nice example ). Assume use of a high-level language such as Python. I have worked with both ZeroMQ and Redis with python. I would say ZeroMQ is more robust, it offers real simple load balancing and also more than pub-sub, like request reply among others. But if you are only after pub-sub, redis is much simpler. In case the redis server

Compiling JZMQ on Ubuntu

纵然是瞬间 提交于 2019-11-29 21:44:20
Hello all I'm attempting to follow the directions located at: https://github.com/nathanmarz/storm/wiki/Installing-native-dependencies for installing Zero MQ as a dependency for Storm on a Ubuntu 12.04 machine. However when trying to run the make command I get the following error Making all in src make[1]: Entering directory `/home/localadmin/jzmq/src' make[1]: *** No rule to make target `classdist_noinst.stamp', needed by `org/zeromq/ZMQ.class'. Stop. make[1]: Leaving directory `/home/localadmin/jzmq/src' make: *** [all-recursive] Error 1 Does anyone have any idea where this error stems from

examples of zeromq pub/sub with C# winform

回眸只為那壹抹淺笑 提交于 2019-11-29 18:48:48
问题 I'm trying to create a C# Winform application that uses ZeroMQ (clrzmq .net bindings (x86) via nuget) in a pub/sub model. After much searching, I can only find standalone C# examples where the code uses a while statement to process new messages indefinitely. When I try to use these examples, I don't know where to put the code, and it just blocks the gui and everything else. I don't know if it's impossible to do without using another thread, but I was under the impression that ZeroMQ's

Pyzmq high-water mark not working on pub socket

允我心安 提交于 2019-11-29 16:57:58
According to the ZeroMQ documentation a pub socket is supposed to drop messages once the number of queued messages reaches the high-water mark. This doesn't seem to work in the following example (and yes I do set the hwm before bind/connect): import time import pickle from threading import Thread import zmq ctx = zmq.Context() def pub_thread(): pub = ctx.socket(zmq.PUB) pub.set_hwm(2) pub.bind('tcp://*:5555') i = 0 while True: # Send message every 100ms time.sleep(0.1) pub.send_string("test", zmq.SNDMORE) pub.send_pyobj(i) i += 1 def sub_thread(): sub = ctx.socket(zmq.SUB) sub.subscribe("test"

ZMQ poll not working

吃可爱长大的小学妹 提交于 2019-11-29 14:11:53
When I run the following code, I get an error on the first call to zmq_poll (i.e. it returns -1 ). The zmq_errno() returns 128 and the zmr_strerror(128) call returns "Unknown error" . I have been using ZMQ with C++ for a while now without any problems, but I can't get a call to zmq_poll to work, no matter how simple it is. Calling zmq::version reveals that I am using ZMQ version 2.1.10. Does anyone have an idea as to why zmq_poll is failing? #include <zmq/zmq.hpp> int main(int argc, char* argv[]) { zmq::context_t context(1); zmq::socket_t repA(context, ZMQ_REP); zmq::socket_t repB(context, ZMQ

Does ZeroMQ have a notification/callback event/message for when data arrives?

淺唱寂寞╮ 提交于 2019-11-29 12:03:14
I am trying to integrate ZMQ into an existing windows application that relies heavily on MFC sockets (CASyncSocket). I've got a CWinThread derived UI thread (without a GUI) that communicates with a server asynchronously using CAsyncSocket. I would like to add a ZMQ inproc communication line to handle communicating the data received from the server (on a REQ/REP basis) to other threads within the application. Using CAsyncSocket, the OnReceive method is called by the MFC framework whenever new data is available on the socket to be received (that might be an over-simplification to the hardcore