Re: [go-nuts] Timers and implementation of a timeout system on requests

2019-05-10 Thread Nathanael Curin
Oh we are definitely not using a single core, haha. Every request is its own set of routines, being careful to not overspawn them though. Le vendredi 10 mai 2019 15:13:45 UTC+2, Robert Engels a écrit : > > One other point, at 5k req/s sustained each request must on average > complete in 200us (i

Re: [go-nuts] Timers and implementation of a timeout system on requests

2019-05-10 Thread Nathanael Curin
The server has 12 cores (2 cpu*6 cores). The tolerance would be about +-10ms, I'd probably check how much time I have on the fly on every request, and remove 10-15ms just "for safety" if anything hangs for a bit too long. I just ran a few tests with a collegue using N simultaneous context.With

Re: [go-nuts] Timers and implementation of a timeout system on requests

2019-05-10 Thread Robert Engels
One other point, at 5k req/s sustained each request must on average complete in 200us (if using a single core) otherwise you will not make your deadlines and you will run out of memory. So 100 ms is way outside the threshold needed. Clearly by upping the parallelism you can increase the time int

Re: [go-nuts] Timers and implementation of a timeout system on requests

2019-05-10 Thread Robert Engels
That being said, 5000 requests per second is pretty low on any reasonable hardware. You can review github/robaho/go-trader - it does 30k requests per sec on desktop machines. > On May 10, 2019, at 7:58 AM, Robert Engels wrote: > > I don’t think your requirements are completely specified. For

Re: [go-nuts] Timers and implementation of a timeout system on requests

2019-05-10 Thread Robert Engels
I don’t think your requirements are completely specified. For example, you say the timeout is 100ms - nothing is ever exact - what is the tolerance in the delay before it is cancelled ? Are the calls in the handler even cancelable? What type of hardware (64+ cores?) I think this is why you are

Re: [go-nuts] Timers and implementation of a timeout system on requests

2019-05-10 Thread Nathanael Curin
Good point on the implementing side of things, it's cleaner. I'm still really curious of the limits and implementation details - There has to be some kind of limit where things start to become erratic. If anyone wants to chime in :) Le jeudi 9 mai 2019 17:23:27 UTC+2, Burak Serdar a écrit : > >

Re: [go-nuts] Timers and implementation of a timeout system on requests

2019-05-09 Thread Burak Serdar
On Thu, May 9, 2019 at 9:03 AM Nathanael Curin wrote: > > Hi everyone, > > Searching Go's documentation and this group didn't really help me find what > I'm looking for so, here goes. > > I'd like to implement a timeout system on every request to my HTTP server > that would work like this : > >

[go-nuts] Timers and implementation of a timeout system on requests

2019-05-09 Thread Nathanael Curin
Hi everyone, Searching Go's documentation and this group didn't really help me find what I'm looking for so, here goes. I'd like to implement a timeout system on every request to my HTTP server that would work like this : - Receive an *http.Request*, perform initial checks on validity -