#1 2018-01-11 11:32:45

turrican
Member
From: Barcelona
Registered: 2015-06-05
Posts: 94
Website

Advice - Boost SynCRTSock.THttpServer

Hi,

First of all, I want to congratulate Synopse team, they are doing a great task! mORMot is one of the big things that changed my mind to not left Pascal. Thanks!

We have made an online (image-resizer & compression) HTTPServer application in Delphi Pascal that uses Synopse low level SynCRTSock.THttpServer. This application is running very well at Azure under AppService with 5 instances(machines quad core). Has replaced a slow .NET Core application based on kestrel running at 10 instances. Our service has more than 30 milions of request/day under a Microsoft ARR and Akamai CDN.

Some advice to improve/optimize SynCRTSock.THttpServer ? If can be improved more. Server constructor param ThreadPool is useful?

Last edited by turrican (2018-01-11 13:01:33)

Offline

#2 2018-01-11 12:29:57

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,237
Website

Re: Advice - Boost SynCRTSock.THttpServer

So you are using the http.sys-based server?
The thread pool default parameter should be good enough for your purpose, since 32 is much higher than your server core count, and most of the time will be spent in the Windows kernel, in the http.sys communication process.

Offline

#3 2018-01-11 12:47:07

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,543
Website

Re: Advice - Boost SynCRTSock.THttpServer

According to our observations in Hi-load systems (for http.sys-based server) we discover a degradation of performance if threadPoll > 24. But this depends of application and processor architecture. Xeon is MUCH faster compared to i7 for example. Also - bare metal is faster when virtual machine.

Offline

#4 2018-01-11 12:59:10

turrican
Member
From: Barcelona
Registered: 2015-06-05
Posts: 94
Website

Re: Advice - Boost SynCRTSock.THttpServer

ab wrote:

So you are using the http.sys-based server?
The thread pool default parameter should be good enough for your purpose, since 32 is much higher than your server core count, and most of the time will be spent in the Windows kernel, in the http.sys communication process.

No, we are using bare TCP THTTPServer because Azure AppServices applications can't use administrator called apis... But we have an IIS proxy (ARR) above. Our constructor is called with 256 value on threadpool parameter.

Last edited by turrican (2018-01-11 13:00:12)

Offline

#5 2018-01-11 20:43:51

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,237
Website

Re: Advice - Boost SynCRTSock.THttpServer

You don't need to run the program with admin rights.
If you register the URI from command line with admin rights, just once (as a regular IIS URI), you can then run the service with normal rights.

Perhaps 256 may be slower than 32, in practice, if you have a proxy, and only 4 cores.
Only you could know which parameter is the best, by trying on real HW and SW.

Offline

#6 2018-01-12 10:45:41

turrican
Member
From: Barcelona
Registered: 2015-06-05
Posts: 94
Website

Re: Advice - Boost SynCRTSock.THttpServer

ab wrote:

You don't need to run the program with admin rights.
If you register the URI from command line with admin rights, just once (as a regular IIS URI), you can then run the service with normal rights.

Azure AppService is a self managed enviorment and can't setup an HTTPApi.sys server at all.

ab wrote:

Perhaps 256 may be slower than 32, in practice, if you have a proxy, and only 4 cores.
Only you could know which parameter is the best, by trying on real HW and SW.

Yeah this is the best way to test it. We will put this line on server Constructor (System.CPUCount * 8 on threadpool size value).

Thanks for your advices.

Offline

Board footer

Powered by FluxBB