-
Notifications
You must be signed in to change notification settings - Fork 97
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
✨ Config option to timeout idle connections within the reqwest
pool
#525
Comments
The issue has been unlocked and is now ready for dev. If you would like to work on this issue, you can comment to have it assigned to you. You can learn more in our contributing guide https://github.com/neon-mmd/websurfx/blob/rolling/CONTRIBUTING.md |
@neon-mmd i would like to work on this issue |
Yes, sure, we would be glad to assign this issue to you, but our suggestion would be to do it step by step like one issue at a time. This allows others who might be willing to contribute to take up these issue as well (in other words, it will not block them from contributing). Actually, we are not suggesting that we will not assign them to you at all. We are just recommending that it would be better to do it step by step so if anyone is willing to contribute, they can also do so without getting blocked. If nobody does take this up, then we will for sure assign it to you. 🙂 . |
@neon-mmd can i work on it now? |
Ok sure, we will assign this issue to you. You may start working on it right away 🚀 🙂 . |
Work Expected From The Issue
Provide a config option under the
server
section of the config to allow users to timeout idle connections within thereqwest
connection pool after a specified period of time to reduce network resource usage. Also, add the new requestpool_idle_timeout
for the same in theClientBuilder
struct in theaggregator.rs
file and provide it with the newly added config option value passed via the function parameters.The issue expects the following files to be changed:
src/results/aggregator.rs
websurfx/config.lua
Note
All the files that are expected to be changed are located under the codebase (
websurfx
directory).Reason Behind These Changes
The reason behind having these changes is to allow the user to tweak the
reqwest
connection pool timeouts which can help reduce server resources automatically.Sample Code
The sample codes for both the files as mentioned above have been provided below:
aggregator.rs
config.lua
-- ### General ### logging = true -- an option to enable or disable logs. debug = false -- an option to enable or disable debug mode. threads = 10 -- the amount of threads that the app will use to run (the value should be greater than 0). -- ### Server ### port = "8080" -- port on which server should be launched binding_ip = "127.0.0.1" --ip address on the which server should be launched. production_use = false -- whether to use production mode or not (in other words this option should be used if it is to be used to host it on the server to provide a service to a large number of users (more than one)) -- if production_use is set to true -- There will be a random delay before sending the request to the search engines, this is to prevent DDoSing the upstream search engines from a large number of simultaneous requests. request_timeout = 30 -- timeout for the search requests sent to the upstream search engines to be fetched (value in seconds). +pool_idle_connection_timeout = 30 -- timeout for the idle connections in the reqwest HTTP connection pool (value in seconds). rate_limiter = { number_of_requests = 20, -- The number of request that are allowed within a provided time limit. time_limit = 3, -- The time limit in which the quantity of requests that should be accepted. } -- ### Search ### -- Filter results based on different levels. The levels provided are: -- {{ -- 0 - None -- 1 - Low -- 2 - Moderate -- 3 - High -- 4 - Aggressive -- }} safe_search = 2 -- ### Website ### -- The different colorschemes provided are: -- {{ -- catppuccin-mocha -- dark-chocolate -- dracula -- gruvbox-dark -- monokai -- nord -- oceanic-next -- one-dark -- solarized-dark -- solarized-light -- tokyo-night -- tomorrow-night -- }} colorscheme = "catppuccin-mocha" -- the colorscheme name which should be used for the website theme -- The different themes provided are: -- {{ -- simple -- }} theme = "simple" -- the theme name which should be used for the website -- The different animations provided are: -- {{ -- simple-frosted-glow -- }} animation = "simple-frosted-glow" -- the animation name which should be used with the theme or `nil` if you don't want any animations. -- ### Caching ### redis_url = "redis://127.0.0.1:8082" -- redis connection url address on which the client should connect on. cache_expiry_time = 600 -- This option takes the expiry time of the search results (value in seconds and the value should be greater than or equal to 60 seconds). -- ### Search Engines ### upstream_search_engines = { DuckDuckGo = true, Searx = false, Brave = false, Startpage = false, LibreX = false, Mojeek = false, Bing = false, } -- select the upstream search engines from which the results should be fetched.
The text was updated successfully, but these errors were encountered: