activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arjen van der Meijden <acmmail...@tweakers.net>
Subject Re: Need help with activemq - php architecture
Date Thu, 14 May 2009 06:04:08 GMT
We have four php-webservers together handling about three million 
pageviews per day, and for each pageview a connection is made to 
ActiveMQ (via Stomp) and at least one, often two and sometimes more 
messages are sent via that connection.

The default settings of ActiveMQ don't really support this fast connect 
rate, but with a few tweaks it works pretty good:
http://www.nabble.com/too-many-open-files-to23473539.html#a23477441
http://www.nabble.com/too-many-open-files-to23473539.html#a23478667

Additionally we have a very short connection timeout in our php-scripts 
connecting via Stomp, so when it doesn't work, the requests aren't 
blocked for fsockopen's default 60 seconds, but just for a tenth of a 
second or so.

I don't really see a reason not to just connect to the ActiveMQ 
directly, the additional store-and-forward won't make things easier and 
is (at least for us) not necessary to be able to handle the connections 
and traffic. Unless you really don't want that extra millisecond or so 
in additional network delays compared to connecting to a local socket.

I doubt you find anything that is not a queue system itself to offer 
this kind of store-and-forward, but you may actually degrade the 
reliability of your message network if you'd use that in between. Most 
"fast queues" I found where not necessarily faster than ActiveMQ+Stomp 
and often not able to persist messages or use acknowledgement before 
removing a message from the queue.

Best regards,

Arjen

On 13-5-2009 18:20 zmiq2 wrote:
> I'm a newbie in activemq, and haven't found much info about setting the
> correct architecture for a high performance php - activemq cluster.
> 
> My planned architecture is:
>  - activemq in server SQ
>  - php in servers S1, S2
> 
> But i'm afraid of every call to a php script, have the php open a network
> connection to SQ, and then send the message to be handled. My idea would be
> to have each php server, S1 and S2, have a little queue relay where php
> scripts connect to its local relay, and it's the relay who, with a permanent
> link to SQ, manages the message transmission.
> 
> How does this architecture sound? Is it good? Where can I find a sample or
> tutorial of this architecture I'm proposing?
> 
> Thanks in advance.
> 

Mime
View raw message