N
N
NektoSam2015-10-13 09:40:55
PHP
NektoSam, 2015-10-13 09:40:55

What is the best way to send messages in MQ (AMQP), TCP or UDP?

Good afternoon,
There is a link shortening service through which about 400 thousand clicks pass per day.
Technically it is implemented as apache + php + memcached. Works great, no bottlenecks yet.
Now there is a need to check destination links for viruses and so on. There are millions of links, so checking them all by the crown is not an option, you need to check only relevant links.
While the next process is being planned
1) The user requests a link XXX
2) The script checks the status of this link in memcache and then allows or denies the redirect
3) If there is no status, then it sends a task for processing through MQ, the link is allowed (it is assumed that a certain percentage of links are skipped not verified)
4) The second script receives tasks from MQ, checks the page, updates the status in memcache
One question. Since all this works in apache + php, the script starts and dies every time. Most MQs run on top of TCP, what if a TCP connection is not available to the MQ server? does it make sense to use udp and which MQ fully works over UDP?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-10-13
Protko @Fesor

the only advantage of UDP is the absence of an overhead to establish a connection. This is beneficial, let's say, for logging, when you write something to the socket (not a lot of data that would fit into the packet) and come what may. In the case of MQ, you still need a message delivery guarantee.
On the other hand, if you connect to the loopback interface (the MQ server will be on the same server as the job source), then there will be practically no overhead, the operating system in this case omits most of the network stack.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question