#1 Re: mORMot 1 » Error saving Blobs to MS SQL via OleDB » 2016-02-18 08:57:31

Thanks, changing the cbMaxLen line fixed the truncate problem for me.

#2 mORMot 1 » Command timeout for TOleDBConnection or TOleDBStatement » 2016-02-17 04:07:51

akirabbq
Replies: 1

Hi, is there any method to set command timeout when executing SQL statements?  My server side is SQL 2008 R2. Thank you.

#3 Re: mORMot 1 » Http Error 406 » 2015-11-16 08:56:41

Thanks you I've just come across the same problem. The buffer shouldn't need to be the same size as the content since the reading part is already being done in a loop. Setting the buffer too large (around 20MB in my case) will throw an ERROR_NO_SYSTEM_RESOURCES (1450) exception.

More info:

https://msdn.microsoft.com/en-us/librar … s.85).aspx

#4 Re: mORMot 1 » Changing the http.sys queue length from default 1000 » 2013-05-14 04:51:31

But still doesn't solve the queue length problem. Under a controlled stress test, the server takes 50ms to finish each request. I've set clone thread size to 256. A sudden burst of ~4000 incoming connection still return status 503 error half of the time.

#5 Re: mORMot 1 » Changing the http.sys queue length from default 1000 » 2013-05-14 01:56:30

mpv wrote:

but I assume the thread pool is for THttpServer but not THttpAPIServer

Please, pay attention to THttpApiServer.Clone method. This one creates the thread pool. Each cloned  thread registers itself to http.sys and then http.sys manages it in the similar way as HttpServer does. As far as I understand you overflow not length of queue, but time request wait in queue. So AB is right - increase thread pool size.

oops.... I've missed the .Clone() function (though it was for something else...). Thx a lot~

#6 Re: mORMot 1 » Changing the http.sys queue length from default 1000 » 2013-05-13 09:28:10

Thx, but I assume the thread pool is for THttpServer but not THttpAPIServer? I've just tried THttpServer and deliberately block OnRequest(), then make 1000 http connections to the server, and the thread count of the server is well over 1000.

The main problem for me is to handle a sudden burst of incoming connection, say > 20000 at the same time. There is no need to process all the request at the same time. Client can wait but should not return any error. One connection per thread is already out of the question. Http API can handle it since it has build-in kernel mode request queue. The queue length can be easily setup in IIS, but it seems there is no easy way to change the value using Http API 1.0 (THttpAPIServer).

Also, afaik, THttpAPIServer can only handle one single OnRequest() at a time. Http.ReceiveHttpRequest() is only called once in the main loop. If OnRequest() is blocked then other incoming connections have to be waited in the request queue until another Http.ReceiveHttpRequest() is called. If the request queue is full then the next client will get an instant 503 error. My idea is to call Http.ReceiveHttpRequest() multiple times and split those requests into different threads.

#7 mORMot 1 » Changing the http.sys queue length from default 1000 » 2013-05-13 06:28:33

akirabbq
Replies: 30

Hi, is it possible to change the queue length? It seems that if the api server's OnRequest() took too long to process, and the incoming queue got filled up to 1000, the next incoming connection will get a 503 error. Under IIS there is an option to change the queue length ("kernel request limit" in IIS6) for a particular application pool (default is 1000), but is there any option to change it under http api server? Thx.

#8 mORMot 1 » SynCommons.UTF8ToString() does not handle surrogate pair properly » 2013-02-04 04:14:57

akirabbq
Replies: 2

For example:
var
  c : ansistring;

....

    setlength(c, 4);
    c[1] := #$F0;
    c[2] := #$A8;
    c[3] := #$B3;
    c[4] := #$92;

System.UTF8ToString(c) and  SynCommons.UTF8ToString(c) give different results. The specific character on unicode.org:

http://www.unicode.org/cgi-bin/GetUniha … 0%A8%B3%92

System's UTF8Tostring results D863 DCD2 which is correct, but SynCommons.UTF8ToString() gives 85C2 003F.

Using CharLength to test the above character's length:
  LStr := UTF8ToString(c);
  CharLength(LStr, 1)

System: 4 (correct, 4 bytes in total for a surrogate pair character)
SynCommons: 2

I have also tried other surrogate unicode pairs and have similar results.

Thanks.

Board footer

Powered by FluxBB