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

What's the purpose of forcing max connection lower than SW_MAX_CONNECTION #2134

Closed
stormeyes opened this issue Nov 20, 2018 · 3 comments
Closed

Comments

@stormeyes
Copy link
Contributor

After upgrading to v4.2.8, we got WARNING swServer_start_check: serv->max_connection is exceed the maximum value[10000]. And we found this commit https://github.com/swoole/swoole-src/commit/bc7fcac06a69bd845c12e553f58d8c7a2115c432 cause this problem.

Our ulimit -n is 100001 and why adding SW_MAX_CONNECTION and force SwooleG.max_sockets lower than 10000 ? BTW, How can I change the SW_MAX_CONNECTION value on PHP level instead of changing the value in .c file and recompile the source code ?

@stormeyes stormeyes changed the title what's the purpose of forcing max connection lower than SW_MAX_CONNECTION What's the purpose of forcing max connection lower than SW_MAX_CONNECTION Nov 20, 2018
@twose
Copy link
Member

twose commented Nov 20, 2018

Please configure the max_connection parameter by the set method.
The reason for this modification is that the default ulimit value on the small memory machine is too large and the service cannot be started.

@twose twose added the question label Nov 20, 2018
@stormeyes
Copy link
Contributor Author

@twose still don't work, code as following:

<?php
$http = new swoole_http_server("127.0.0.1", 9501);

$http->set(['max_conn' => 50000]);

$http->on("start", function ($server) {
    echo "Swoole http server is started at http://127.0.0.1:9501\n";
});

$http->on("request", function ($request, $response) {
    $response->header("Content-Type", "text/plain");
    $response->end("Hello World\n");
});

$http->start();

image

@twose
Copy link
Member

twose commented Nov 20, 2018

Sorry, it's a bug on commit bc7fcac

@twose twose added Bug and removed question labels Nov 20, 2018
@twose twose closed this as completed in 0d64a0d Nov 20, 2018
@twose twose added the fixed label Nov 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants