I tried the following config.json, but always failed, the ss-server always promote me to input parameters and show me usage.
{
"server":"0.0.0.0",
"port_password": {
"8387": "foobar2",
"8388": "foobar1"
},
"timeout":60,
"method":"rc4"
}
another example of multi-port
https://github.com/shadowsocks/shadowsocks-go/blob/master/sample-config/server-multi-port.json
Sorry, we have no plan to support multi port configuration. Actually you can use multiple instances instead. For example:
ss-server -c config1.json -f pid1
ss-server -c config2.json -f pid2
ss-server -c config3.json -f pid3
As the best practice we recommend for shadowsocks-libev, it helps to isolate each user in different processes and reconfigure each user's port/password/encyption/timeout without reload/restart the whole service. Furthermore, this approach enables us to manage users with legacy control panels, for example old SSH / VHOST panels with each user's ss-server running in its own space.
Compared to other implementations, shadowsocks-libev uses much fewer resources (about 1MB memory and hundreds of file descriptors in a typical usage) . As a result, this kind of multi processes should only introduce slight overhead and even works well for low end boxes.
OK. your comments make it very clear to me. I will use multiple instances.
thanks your help again and thanks your perfect shadowsocks-libev very much.
Thanks.
Running multiple instances is not feasible when supporting thousands of users. Is it possible to make shadowsocks start through inetd or xinetd? It would require only minimal changes to shadowsocks and instantly makes it scalable.
(Using the Go version at the moment, but it's not as stable and well-maintained as this libev version.)
Sorry, we have no plan to support multi port configuration. Actually you can use multiple instances instead. For example:
ss-server -c config1.json -f pid1 ss-server -c config2.json -f pid2 ss-server -c config3.json -f pid3As the best practice we recommend for
shadowsocks-libev, it helps to isolate each user in different processes and reconfigure each user's port/password/encyption/timeout without reload/restart the whole service. Furthermore, this approach enables us to manage users with legacy control panels, for example old SSH / VHOST panels with each user'sss-serverrunning in its own space.Compared to other implementations,
shadowsocks-libevuses much fewer resources (about 1MB memory and hundreds of file descriptors in a typical usage) . As a result, this kind of multi processes should only introduce slight overhead and even works well for low end boxes.
How do you configure multiple instances as a service? The wiki couldn't be more general :D
@wisicn Try ss-manager and just dump your original json config file to the destination directory if you don't really care about changing service type from forking (ss-server) to simple (ss-manager) and a systemctl daemon-reload.
@addohm What about creating a oneshot systemd service?
But what I was thinking is that ss-local ss-tunnel should have features like multi-port configuration for build-in load balancing (in case servers won't be blocked because of large amount of traffic; GFW has some creepy rules) -- that's another story though.
Most helpful comment
Sorry, we have no plan to support multi port configuration. Actually you can use multiple instances instead. For example:
As the best practice we recommend for
shadowsocks-libev, it helps to isolate each user in different processes and reconfigure each user's port/password/encyption/timeout without reload/restart the whole service. Furthermore, this approach enables us to manage users with legacy control panels, for example old SSH / VHOST panels with each user'sss-serverrunning in its own space.Compared to other implementations,
shadowsocks-libevuses much fewer resources (about 1MB memory and hundreds of file descriptors in a typical usage) . As a result, this kind of multi processes should only introduce slight overhead and even works well for low end boxes.