What is the best way to run ServiceStack on Linux / Mono?

前端 未结 5 646
自闭症患者
自闭症患者 2020-11-30 17:01

Listed on the ServiceStack website it shows that ServiceStack can run on Mono with either:

  • XSP
  • mod_mono
  • FastCgi
  • Console
5条回答
  •  失恋的感觉
    2020-11-30 17:27

    In production we use nginx with unix file sockets

    We found a bug/memory leak when using socket communication with nginx, service stack and mono. This was with 500 concurrent requests, whilst you'd expect a spike in cpu and memory it never came back down again. We didn't do any further testing to discover where the problem was but there is a bug logged with xamarin bugzilla that seems similar to the issues we had. Essentially we tried the following and it was good enough for us.

    We switched to using unix sockets with the following command params

    fastcgi-mono-server4 /filename=/tmp/something.socket /socket=unix /applications=/var/www/

    The problem we had with this method is that the permissions of the socket file changed everytime you run fastcgi-mono-server4 so you have to correct them after you've started fastcgi-mono-server4! The other downside is that on our boxes it could only handle about 120 concurrent requests. However this isn't really an issue for us at the moment and you can always spawn more processes.

    Hope this helps

提交回复
热议问题