GeniusesOfSymfony / WebSocketBundle

:part_alternation_mark: Websocket server for Symfony applications (powered by Ratchet), includes a Autobahn.JS based JavaScript client
MIT License
608 stars 140 forks source link

Apache Threads Number #234

Open eduardo5000 opened 7 years ago

eduardo5000 commented 7 years ago

Hello,

we have your bundle in our company running. In a physical machine and in a VPS.

A bit later we had run the websocket bundle the number of apache threads grow up so much. We can have 150 apache threads.

Apache in the VPS crash directly.

Do you know why?

What can we do to get things right?

Thx !

eduardo5000 commented 7 years ago

We are using zmq. And we have 200 users concurrently. The app is sending notifications continously.

We use your bundle to count the number of connected users, too.

Thx!

jjsaunier commented 7 years ago

Hey, what do you mean by "apache threads" ? It's the number of opened connections ?

If you have 200 users it's normal to have like 150 connections opened from apache side. May be you need to tune your server configuration to handle it correctly.

What kind of resources is becoming busy when load is coming ? (cpu, ram etc) What are the specs of your VPS ?

I have no experience with apache :( So I can't really help you to figured out if problem come from apache config :/)

eduardo5000 commented 7 years ago

We're tunning apache mpm parameters. We use prefork:

.- StartServers .- MinSpareServers .- MaxSpareServers .- MaxClients .- MaxRequestsPerChild

We have to restart apache server because is hanging every day.

Thx !

jjsaunier commented 7 years ago

Are you using Apache server as reverse proxy for websocket connection ? If you are not, this problem is not related by the fact that your are using websocket app.

And if you are using Apache as reverse proxy, show me the socket configuration, because I know, Apache require a specific module in order proxy the socket connection.

Mpm prefork is related to http request only as regular such as fpm. Websocket server is not served by mpm or fpm.

Le ven. 21 avr. 2017 08:32, eduardo5000 notifications@github.com a écrit :

We're tunning apache mpm parameters. We use prefork:

.- StartServers .- MinSpareServers .- MaxSpareServers .- MaxClients .- MaxRequestsPerChild

We have to restart apache server because is hanging every day.

Thx !

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/GeniusesOfSymfony/WebSocketBundle/issues/234#issuecomment-296091741, or mute the thread https://github.com/notifications/unsubscribe-auth/ABroDbXPLspDKPGfXqf5zScMa3Uec16Mks5ryE1_gaJpZM4NC9j4 .

eduardo5000 commented 7 years ago

Yes we're using reverse proxy from apache. Our configuration is:

<VirtualHost *:80> <Location "/wsauthoban"> ProxyPass "ws://domain:8090/"

domain is our internal domain.

Apache2ctl -M shows this:

core_module (static) so_module (static) watchdog_module (static) http_module (static) log_config_module (static) logio_module (static) version_module (static) unixd_module (static) access_compat_module (shared) alias_module (shared) auth_basic_module (shared) authn_core_module (shared) authn_file_module (shared) authz_core_module (shared) authz_host_module (shared) authz_user_module (shared) autoindex_module (shared) deflate_module (shared) dir_module (shared) env_module (shared) filter_module (shared) mime_module (shared) mpm_prefork_module (shared) negotiation_module (shared) php5_module (shared) proxy_module (shared) proxy_wstunnel_module (shared) setenvif_module (shared) socache_shmcb_module (shared) ssl_module (shared) status_module (shared)

We're using reverse proxy because we can only leave from intranet by port 80.

Thx !