select: неверный аргумент в ssh localforward - PullRequest
0 голосов
/ 07 декабря 2018

У меня есть файл конфигурации с настройками localforward, как показано ниже

LocalForward 8443 remoteserver.com:8443

После того, как я войду в него в режиме отладки и начну отправлять много запросов на удаленный сервер, ясм. строки ниже

debug1: channel 1017: new [direct-tcpip]
debug1: channel 0: free: port listener, nchannels 1018
debug1: channel 1: free: port listener, nchannels 1017
debug1: channel 2: free: port listener, nchannels 1016
debug1: channel 3: free: port listener, nchannels 1015
debug1: channel 4: free: port listener, nchannels 1014
debug1: channel 5: free: port listener, nchannels 1013
debug1: channel 6: free: port listener, nchannels 1012
debug1: channel 7: free: port listener, nchannels 1011
debug1: channel 8: free: direct-tcpip: listening port 8443 for remotserver.com port 8443, connect from 127.0.0.1 port 49991 to 127.0.0.1 port 8443, nchannels 1010
debug1: channel 9: free: direct-tcpip: listening port 8443 for remoteserver.com port 8443, connect from 127.0.0.1 port 49992 to 127.0.0.1 port 8443, nchannels 1009
.
.

debug1: channel 1016: free: direct-tcpip: listening port 8443 for remoteserver.com port 8443, connect from 127.0.0.1 port 51113 to 127.0.0.1 port 8443, nchannels 2
debug1: channel 1017: free: direct-tcpip: listening port 8443 for remoteserver.com port 8443, connect from 127.0.0.1 port 51114 to 127.0.0.1 port 8443, nchannels 1
select: Invalid argument

, и SSH прерывается / выходит с «select: Invalid аргумент».Я мог видеть, что nchannels уменьшилось до 1, и это было не в состоянии сделать больше каналов.Ниже выводится «ulimit -aH» на моей машине.

core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
max locked memory       (kbytes, -l) unlimited
max memory size         (kbytes, -m) unlimited
open files                      (-n) 524288
pipe size            (512 bytes, -p) 1
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 2048
virtual memory          (kbytes, -v) unlimited

Могу ли я узнать, какая конфигурация устанавливает ограничение числа каналов на ~ 1024 или около того, и как я могу увеличить его, чтобы отправить 10000+запросы от моей машины асинхронно.

Вот код Python для отправки этих запросов

async def async_fun(self, loop):
    for record in enumerate(record_list): #10000+ records 
        task = loop.run_in_executor(
                concurrent.futures.ThreadPoolExecutor(max_workers=3),
                self._fun,
                record,
                )
        futures.append(task)

    await asyncio.gather(*futures, return_exceptions=True)
...