Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saw this... but why not? #23

Closed
unisqu opened this issue Jun 11, 2018 · 6 comments
Closed

Saw this... but why not? #23

unisqu opened this issue Jun 11, 2018 · 6 comments

Comments

@unisqu
Copy link

unisqu commented Jun 11, 2018

You would not want to use this framework if you need to handle long-running requests (milliseconds or more). For example, a web api that needs to connect to a mongo database, authenticate, and respond; just use the Go net/http package instead.

Why not? What will be the problem if I do so? Most request will be sub milliseconds but just one or two will be in the milliseconds... but I'm curious what will the problem be... can you elaborate?

@tidwall
Copy link
Owner

tidwall commented Jun 11, 2018

Because you risk having a sluggish server.

I'm very picky when it comes to performance and for me a millisecond can feel like an eternity, but ultimately it depends on your tolerance level.

An Evio loop can only process one event at a time. Long running operations can block the entire loop and make the system feel slow. I do not recommend using Evio when the duration of an operation cannot be determined, such as making network calls to non-local services.

With the standard Go net package this is a non-issue because the Go scheduler is so damn good.

I generally use Go's net package by default. And then Evio for specialized use cases, where each request has a predicable response time.

@unisqu
Copy link
Author

unisqu commented Jun 12, 2018

where is the timeout configuration for this?

@tidwall
Copy link
Owner

tidwall commented Jun 12, 2018

What do you mean by timeout?

@unisqu
Copy link
Author

unisqu commented Jun 12, 2018

I do not recommend using Evio when the duration of an operation cannot be determined, such as making network calls to non-local services.

we can just time out this connection. so why is there no timeout configuration feature?

@tidwall
Copy link
Owner

tidwall commented Jun 12, 2018

If by timeout, you mean something like conn.SetDeadline. That’s not a feature that I have on the roadmap.

If you are concerned with IO deadlines then I recommend that you use the net package. It provides timeout operations.

@unisqu
Copy link
Author

unisqu commented Jun 13, 2018

what a waste. it just lacks that timeout feature.

@unisqu unisqu closed this as completed Jun 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants