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

Concurrency limit? #31

Closed
xmflsct opened this issue Dec 29, 2021 · 16 comments
Closed

Concurrency limit? #31

xmflsct opened this issue Dec 29, 2021 · 16 comments

Comments

@xmflsct
Copy link

xmflsct commented Dec 29, 2021

Getting

2021/12/29 17:24:25 The incoming connection cannot be served, because 262144 concurrent connections are served. Try increasing Server.Concurrency

How to increase concurrency? Thanks!

@mikekonan
Copy link
Owner

mikekonan commented Dec 29, 2021

Hello, how many proxy clients do you have? Is it freqtrade bots or something else?

@xmflsct
Copy link
Author

xmflsct commented Dec 30, 2021

Not so many, it was around 10-11 freqtrade instances running. I have another VM which runs perfectly with 18 freqtrade instances. I suspect it is because of pairs not clients?

@mikekonan
Copy link
Owner

It's because of amounts of requests, so the limit has to be increased.

@mikekonan
Copy link
Owner

Has proxy crashed?

@xmflsct
Copy link
Author

xmflsct commented Dec 30, 2021

No, the proxy did not crash, at least not from Docker's point of view.

The situation just appeared on my other VM which hosts that 18 freqtrade instances. Very weird. Don't know how to properly reproduce the situation. Will monitor a bit further.

@mikekonan
Copy link
Owner

fastHttp server has its own connection pool with a 1024*256 connection limit. So I will make it configurable in the next release

@mikekonan
Copy link
Owner

#v1.2.1 added -concurrency-limit parameter

@xmflsct
Copy link
Author

xmflsct commented Jan 2, 2022

Thanks! What is a reasonable amount to set? 1024*256 seems already high, but not sure how many to count for each instance?

@mikekonan
Copy link
Owner

Actually, I don't know, so I recommend you increase that twice until the issue would not occurs. Also, it's could be an issue with freqtrade HTTP client that does not close connections in time.

@mikekonan
Copy link
Owner

What is the output of "ulimit -n"?

@xmflsct
Copy link
Author

xmflsct commented Jan 5, 2022

ulimit -n

In which context?

@xmflsct xmflsct closed this as completed Jan 5, 2022
@mikekonan
Copy link
Owner

On your Linux instance

@xmflsct
Copy link
Author

xmflsct commented Jan 6, 2022

On the Linux VM, the result is 1024.
In the docker container that runs freqtrade instance, the result is 1048576.

@mikekonan
Copy link
Owner

What is the output of sudo lsof -Pi -p $PROXY_PID? From your host

@mikekonan
Copy link
Owner

Also, I suggest checking the amount of opened file descriptions on your instance - https://www.cyberciti.biz/tips/linux-procfs-file-descriptors.html

@xmflsct
Copy link
Author

xmflsct commented Jan 12, 2022

sudo lsof -Pi -p $PROXY_PID shows a long list.

The total count currently is 222.

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