From alx.manpages at gmail.com Fri Mar 4 00:41:28 2022 From: alx.manpages at gmail.com (Alejandro Colomar (man-pages)) Date: Fri, 4 Mar 2022 01:41:28 +0100 Subject: HTTP status for directories Message-ID: <670eb685-29bd-3df5-6b7c-dabb41f999a8@gmail.com> Hi Valentin, As I finished the implementation of "index" supporting an empty array, I did some deep testing, and got something interesting. It works as expected, but there's still something that may not be what we want. When a dir is requested, the behavior is different right now for the following two cases: user at ADY-debian-11:~/src/nginx/unit$ curl --dump-header - localhost/dir HTTP/1.1 301 Moved Permanently Location: /dir/ Server: Unit/1.27.0 Date: Thu, 03 Mar 2022 23:58:58 GMT Content-Length: 0 user at ADY-debian-11:~/src/nginx/unit$ curl --dump-header - localhost/dir/ HTTP/1.1 404 Not Found Content-Type: text/html Server: Unit/1.27.0 Date: Thu, 03 Mar 2022 23:59:01 GMT Content-Length: 54 Error 404

Error 404. The redirect makes sense, but we're not showing the 404 page after the redirection. It serves 0 bytes. Is that correct? Thanks, Alex -- Alejandro Colomar Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/ http://www.alejandro-colomar.es/ From vbart at nginx.com Fri Mar 4 00:57:52 2022 From: vbart at nginx.com (Valentin V. Bartenev) Date: Fri, 04 Mar 2022 03:57:52 +0300 Subject: HTTP status for directories In-Reply-To: <670eb685-29bd-3df5-6b7c-dabb41f999a8@gmail.com> References: <670eb685-29bd-3df5-6b7c-dabb41f999a8@gmail.com> Message-ID: <4406244.LvFx2qVVIh@vbart-laptop> On Friday, 4 March 2022 03:41:28 MSK Alejandro Colomar (man-pages) wrote: > Hi Valentin, > > As I finished the implementation of "index" supporting an empty array, I > did some deep testing, and got something interesting. It works as > expected, but there's still something that may not be what we want. > > When a dir is requested, the behavior is different right now for the > following two cases: > > user at ADY-debian-11:~/src/nginx/unit$ curl --dump-header - localhost/dir > HTTP/1.1 301 Moved Permanently > Location: /dir/ > Server: Unit/1.27.0 > Date: Thu, 03 Mar 2022 23:58:58 GMT > Content-Length: 0 > > user at ADY-debian-11:~/src/nginx/unit$ curl --dump-header - localhost/dir/ > HTTP/1.1 404 Not Found > Content-Type: text/html > Server: Unit/1.27.0 > Date: Thu, 03 Mar 2022 23:59:01 GMT > Content-Length: 54 > > Error 404

Error 404. > > > The redirect makes sense, but we're not showing the 404 page after the > redirection. It serves 0 bytes. Is that correct? [..] It serves 0 bytes for the "301 Moved Permanently", which is ok as any payload for the 301 code isn't displayed in browsers anyway. What do you mean by not showing the 404 page? The "curl" command just doesn't follow the redirect by default. In order to instruct curl to follow redirctions, you need to specify the -L option: curl -L localhost/dir -- Valentin From alx.manpages at gmail.com Fri Mar 4 11:48:53 2022 From: alx.manpages at gmail.com (Alejandro Colomar (man-pages)) Date: Fri, 4 Mar 2022 12:48:53 +0100 Subject: HTTP status for directories In-Reply-To: <4406244.LvFx2qVVIh@vbart-laptop> References: <670eb685-29bd-3df5-6b7c-dabb41f999a8@gmail.com> <4406244.LvFx2qVVIh@vbart-laptop> Message-ID: <32518dad-61b7-bbe1-5802-49d91ca0e095@gmail.com> On 3/4/22 01:57, Valentin V. Bartenev wrote:> It serves 0 bytes for the "301 Moved Permanently", which is ok as any > payload for the 301 code isn't displayed in browsers anyway. > > What do you mean by not showing the 404 page? The "curl" command just > doesn't follow the redirect by default. In order to instruct curl to > follow redirctions, you need to specify the -L option: > > curl -L localhost/dir Ahh, your right, I was missing -L for the redirection. It seems that it's working as it should: user at ADY-debian-11:~$ curl -L --dump-header - localhost/dir HTTP/1.1 301 Moved Permanently Location: /dir/ Server: Unit/1.27.0 Date: Fri, 04 Mar 2022 11:47:10 GMT Content-Length: 0 HTTP/1.1 404 Not Found Content-Type: text/html Server: Unit/1.27.0 Date: Fri, 04 Mar 2022 11:47:10 GMT Content-Length: 54 Error 404

Error 404. Thanks, Alex -- Alejandro Colomar Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/ http://www.alejandro-colomar.es/ From kaystein92 at gmail.com Fri Mar 4 12:44:31 2022 From: kaystein92 at gmail.com (Kay Stein) Date: Fri, 4 Mar 2022 06:44:31 -0600 Subject: HTTP status for directories In-Reply-To: <32518dad-61b7-bbe1-5802-49d91ca0e095@gmail.com> References: <670eb685-29bd-3df5-6b7c-dabb41f999a8@gmail.com> <4406244.LvFx2qVVIh@vbart-laptop> <32518dad-61b7-bbe1-5802-49d91ca0e095@gmail.com> Message-ID: Please remove me. On Fri, Mar 4, 2022, 5:49 AM Alejandro Colomar (man-pages) < alx.manpages at gmail.com> wrote: > On 3/4/22 01:57, Valentin V. Bartenev wrote:> It serves 0 bytes for the > "301 Moved Permanently", which is ok as any > > payload for the 301 code isn't displayed in browsers anyway. > > > > What do you mean by not showing the 404 page? The "curl" command just > > doesn't follow the redirect by default. In order to instruct curl to > > follow redirctions, you need to specify the -L option: > > > > curl -L localhost/dir > > Ahh, your right, I was missing -L for the redirection. > It seems that it's working as it should: > > user at ADY-debian-11:~$ curl -L --dump-header - localhost/dir > HTTP/1.1 301 Moved Permanently > Location: /dir/ > Server: Unit/1.27.0 > Date: Fri, 04 Mar 2022 11:47:10 GMT > Content-Length: 0 > > HTTP/1.1 404 Not Found > Content-Type: text/html > Server: Unit/1.27.0 > Date: Fri, 04 Mar 2022 11:47:10 GMT > Content-Length: 54 > > Error 404

Error 404. > > > > Thanks, > Alex > > -- > Alejandro Colomar > Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/ > http://www.alejandro-colomar.es/ > _______________________________________________ > unit mailing list -- unit at nginx.org > To unsubscribe send an email to unit-leave at nginx.org > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ranier.vf at gmail.com Fri Mar 4 12:58:00 2022 From: ranier.vf at gmail.com (Ranier Vilela) Date: Fri, 4 Mar 2022 09:58:00 -0300 Subject: HTTP status for directories In-Reply-To: References: <670eb685-29bd-3df5-6b7c-dabb41f999a8@gmail.com> <4406244.LvFx2qVVIh@vbart-laptop> <32518dad-61b7-bbe1-5802-49d91ca0e095@gmail.com> Message-ID: Em sex., 4 de mar. de 2022 às 09:45, Kay Stein escreveu: > Please remove me. > Me too! regards, Ranier Vilela --Honor for Valery Skakun. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx at kinetiksoft.com Fri Mar 11 08:58:02 2022 From: nginx at kinetiksoft.com (=?UTF-8?B?0JjQstCw0L0=?=) Date: Fri, 11 Mar 2022 10:58:02 +0200 Subject: =?UTF-8?B?dW5pdCDQt9Cw0LLQuNGB0LDQtdGCINGBIHBocCA3LjQgKG5naW54K3Vu?= =?UTF-8?Q?it+nextcloud_=d0=bd=d0=b0_debian_11=29?= Message-ID: Здравствуйте! Перевели nextcloud (php) на unit. Периодически unit полностью перестаёт отвечать на запросы. В этот момент запрос к любому урлу с application nextcloud , обламывается по timeout. В логах nginx соотвественно 2022/03/11 10:48:37 [error] 156145#156145: *43083 upstream timed out (110: Connection timed out) while reading response header from upstre am, client: 46.55, server: c.com, request: "GET /thecloud/ocs/v2.php/apps/activity/api/v2/activity?since=1883732&li mit=50&format=json HTTP/1.1", upstream: "http://127.0.0.1:8000/thecloud/ocs/v2.php/apps/activity/api/v2/activity?since=1883732&limit=50&fo rmat=json", host: "c.com" В логах unit вообще смущает > grep -c 'Resource temporarily unavailable' /var/log/unit.log > 94542 Мы уже выставили ему NoFiles = 10000, пробуем поставить 100000 и перенести сессии php в редис, может что-то еще не учли? Дебаг-логи юнита включили, но ничего соотвествующего проблеме не увидели. Например, приведенное выше сообщение в логах nginx - первое за сегодня. Кусок лога unit за это время: > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 h1p body rest: 0 > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 http application > handler > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 rpc: stream > #23217 registered > 2022/03/11 10:48:36.250 [debug] 244884#244901 mp 7F0600049E30 retain: 2 > 2022/03/11 10:48:36.250 [debug] 244884#244901 > pthread_mutex_lock(55E27D377000) enter > 2022/03/11 10:48:36.250 [debug] 244884#244901 > pthread_mutex_unlock(55E27D377000) exit > 2022/03/11 10:48:36.250 [debug] 244884#244901 mp 7F0600049E30 retain: 3 > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 request 1345 > bytes shm buffer > 2022/03/11 10:48:36.250 [debug] 244884#244901 mp 7F0600000BB0 retain: 25 > 2022/03/11 10:48:36.250 [debug] 244884#244901 > pthread_mutex_lock(55E27D377138) enter > 2022/03/11 10:48:36.250 [debug] 244884#244901 > pthread_mutex_unlock(55E27D377138) exit > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 outgoing mmap buf > allocation: 7F0600028600 [7F06091F5000,16384] 244884->0,0,24 > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 fields_count=13 > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xE6EB, > 0, 4, 7F0600049171 : 21 7F0600049177 > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x7F29, > 0, 15, 7F060004918E : 12 7F060004919F > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x25AB, > 0, 10, 7F06000491AD : 5 7F06000491B9 > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x1EA0, > 0, 14, 7F06000491C0 : 3 7F06000491D0 > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xA841, > 0, 5, 7F06000491D5 : 1 7F06000491DC > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xB29A, > 0, 13, 7F06000491DF : 42 7F06000491EE > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x0220, > 0, 10, 7F060004921A : 145 7F0600049226 > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xD871, > 0, 6, 7F06000492B9 : 3 7F06000492C1 > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x5F7D, > 0, 12, 7F06000492C6 : 23 7F06000492D4 > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xEDFF, > 0, 12, 7F06000492ED : 36 7F06000492FB > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x23F2, > 0, 6, 7F0600049321 : 277 7F0600049329 > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x9683, > 0, 15, 7F0600049440 : 13 7F0600049451 > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xEA97, > 0, 15, 7F0600049460 : 10 7F0600049471 > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 about to send > 1345 bytes buffer to app process port 12 > 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 queue is not empty > 2022/03/11 10:48:36.250 [debug] 244884#244901 timer found minimum: > 313989843±50:313748980 > 2022/03/11 10:48:36.250 [debug] 244884#244901 epoll_wait(36) > timeout:240863 > 2022/03/11 10:48:37.114 [debug] 244884#244901 epoll_wait(36): 1 > 2022/03/11 10:48:37.114 [debug] 244884#244901 *22733 epoll: fd:17 > ev:2001 d:7F060001D390 rd:2 wr:0 > 2022/03/11 10:48:37.114 [debug] 244884#244901 timer expire minimum: > 313989793:313749844 > 2022/03/11 10:48:37.114 [debug] 244884#244901 timer found minimum: > 313989843±50:313749844 > 2022/03/11 10:48:37.114 [debug] 244884#244901 epoll_wait(36) > timeout:239999 > 2022/03/11 10:48:37.146 [debug] 244884#244901 epoll_wait(36): 1 > 2022/03/11 10:48:37.146 [debug] 244884#244901 *22735 epoll: fd:19 > ev:2001 d:7F06000029C0 rd:2 wr:0 > 2022/03/11 10:48:37.146 [debug] 244884#244901 timer expire minimum: > 313989793:313749876 > 2022/03/11 10:48:37.146 [debug] 244884#244901 timer found minimum: > 313989843±50:313749876 > 2022/03/11 10:48:37.146 [debug] 244884#244901 epoll_wait(36) > timeout:239967 > 2022/03/11 10:48:37.190 [debug] 244884#244901 epoll_wait(36): 1 > 2022/03/11 10:48:37.190 [debug] 244884#244901 *22736 epoll: fd:20 > ev:2001 d:7F060000F710 rd:2 wr:0 > 2022/03/11 10:48:37.190 [debug] 244884#244901 timer expire minimum: > 313989793:313749920 > 2022/03/11 10:48:37.190 [debug] 244884#244901 timer found minimum: > 313989843±50:313749920 > 2022/03/11 10:48:37.190 [debug] 244884#244901 epoll_wait(36) > timeout:239923 > 2022/03/11 10:48:43.946 [debug] 244884#244901 epoll_wait(36): 1 > 2022/03/11 10:48:43.946 [debug] 244884#244901 epoll: fd:14 ev:0001 > d:7F0600001430 rd:5 wr:0 > 2022/03/11 10:48:43.946 [debug] 244884#244901 timer expire minimum: > 313989793:313756676 > 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: accept > 2022/03/11 10:48:43.946 [debug] 244884#244901 accept4(14): 102 > 2022/03/11 10:48:43.946 [debug] 244884#244901 client: 127.0.0.1 > 2022/03/11 10:48:43.946 [debug] 244884#244901 malloc(168): 7F0600005F70 > 2022/03/11 10:48:43.946 [debug] 244884#244901 posix_memalign(16, 464): > 7F060004B2E0 > 2022/03/11 10:48:43.946 [debug] 244884#244901 *22761 connections: 26 > 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: accept > 2022/03/11 10:48:43.946 [debug] 244884#244901 accept4(14) (11: > Resource temporarily unavailable) > 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: read > 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 http conn init > 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: read > 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 conn read fd:102 > rdy:0 cl:0 er:0 bl:0 > 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 epoll 36 set > event: fd:102 op:1 ev:80002001 > 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 timer add: 0±50 > 180000:313936676 > 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 timer change: > 313936676±50:1 > 2022/03/11 10:48:43.946 [debug] 244884#244901 timers changes: 1 Конфиг unit'а: > { >     "settings": { >         "http": { >             "max_body_size": 10737418240, >             "body_read_timeout": 3600 >         } >     }, >     "listeners": { >         "127.0.0.1:8000": { >             "pass": "routes", >         "client_ip": { >             "header": "X-Forwarded-For", >             "source": [ >             "127.0.0.1" >             ] >         } >         } >     }, > >     "routes": [ >         { >             "match": { >                 "uri": [ >                     "/thecloud/core/ajax/update.php*", >                     "/thecloud/cron.php*", >                     "/thecloud/index.php*", >                     "/thecloud/ocm-provider*.php*", >                     "/thecloud/ocs-provider*.php*", >                     "/thecloud/ocs/v1.php*", >                     "/thecloud/ocs/v2.php*", >                     "/thecloud/public.php*", >                     "/thecloud/remote.php*", >                                         "/thecloud/status.php*", >                     "/thecloud/updater*.php*" >                 ] >             }, > >             "action": { >                 "pass": "applications/nextcloud/direct" >             } >         }, >         { >             "match": { >                 "uri": "/thecloud/ocm-provider*" >             }, > >             "action": { >                 "pass": "applications/nextcloud/ocm" >             } >         }, >         { >             "match": { >                 "uri": "/thecloud/ocs-provider*" >             }, > >             "action": { >                 "pass": "applications/nextcloud/ocs" >             } >         }, >         { >             "match": { >                 "uri": "/thecloud/updater*" >             }, > >             "action": { >                 "pass": "applications/nextcloud/updater" >             } >         }, >         { >             "match": { >                 "uri": "/thecloud/*" >             }, >             "action": { >                 "share": "/usr/local$uri", >                 "fallback": { >                     "pass": "applications/nextcloud/index" >                 } >             } >         }, >         { >             "action": { >                 "return": 403 >             } >         } >     ], > >     "applications": { >         "nextcloud": { >             "user": "php-nextcloud", >             "group": "php-nextcloud", >             "limits": { >                     "timeout": 300, >                     "requests": 10000 >             }, >                 "processes": { >                 "max": 20, >                 "spare": 10, >                 "idle_timeout": 300 >             }, >             "options": { >                 "admin": { >                     "memory_limit": "512M", >                     "post_max_size": "10G", >                     "upload_max_filesize": "10G", >                     "max_execution_time": "3600", >                     "max_input_time": "3600" >                 } >             }, >             "type": "php", >             "targets": { >                 "direct": { >                     "root": "/usr/local/" >                 }, > >                 "index": { >                     "root": "/usr/local/nextcloud/", >                     "script": "index.php" >                 }, > >                 "ocm": { >                     "root": "/usr/local/nextcloud/ocm-provider/", >                     "script": "index.php" >                 }, > >                 "ocs": { >                     "root": "/usr/local/nextcloud/ocs-provider/", >                     "script": "index.php" >                 }, > >                 "updater": { >                     "root": "/usr/local/nextcloud/updater/", >                     "script": "index.php" >                 } >             } >         } >     } > } Заранее спасибо! С уважением, Иван. From max.romanov at nginx.com Mon Mar 14 08:00:24 2022 From: max.romanov at nginx.com (Max Romanov) Date: Mon, 14 Mar 2022 11:00:24 +0300 Subject: =?utf-8?B?UmU6IHVuaXQg0LfQsNCy0LjRgdCw0LXRgiDRgSBwaHAgNy40IChu?= =?utf-8?B?Z2lueCt1bml0K25leHRjbG91ZCDQvdCwIGRlYmlhbiAxMSk=?= In-Reply-To: References: Message-ID: <7D75FA2A-0C1F-4AB2-B473-6B37F3F6AA3C@nginx.com> Здравствуйте, Иван. Похоже, что процессу 'unit: router' (pid 244884) не хватает файловых дескрипторов для принятия очередного клиентского соединения. Чтобы убедиться, что это так, можно посчитать кол-во используемых дескрипторов (напр. 'lsof -p 244884') и сравнить со значениями в строке 'Max open files' в /proc/244884/limits . Если кол-во дескрипторов маленькое на фоне 'Resource temporarily unavailable', то предположение неверное. Если кол-во дескрипторов большое, но существенно отличается от количества подключений, надо искать утечку дескрипторов в роутере (возможно, ошибка в Unit). Если кол-во используемых дескрипторов близко к предельному и (примерно) соответствует количеству клиентских соединений, то необходимо увеличить лимит. > > Мы уже выставили ему NoFiles = 10000, пробуем поставить 100000 и перенести сессии php в редис, может что-то еще не учли? > Направление похожее, но я не понял _где_ это выставлено. Повиляло ли это на /proc//limits ? Если нет - значит не та (или не там) настройка. — Max > On 11 Mar 2022, at 11:58, Иван wrote: > > Здравствуйте! > > > Перевели nextcloud (php) на unit. Периодически unit полностью перестаёт отвечать на запросы. В этот момент запрос к любому урлу с application nextcloud , обламывается по timeout. В логах nginx соотвественно > > 2022/03/11 10:48:37 [error] 156145#156145: *43083 upstream timed out (110: Connection timed out) while reading response header from upstre > am, client: 46.55, server: c.com, request: "GET /thecloud/ocs/v2.php/apps/activity/api/v2/activity?since=1883732&li > mit=50&format=json HTTP/1.1", upstream: "http://127.0.0.1:8000/thecloud/ocs/v2.php/apps/activity/api/v2/activity?since=1883732&limit=50&fo > rmat=json", host: "c.com" > > В логах unit вообще смущает > >> grep -c 'Resource temporarily unavailable' /var/log/unit.log >> 94542 > > Мы уже выставили ему NoFiles = 10000, пробуем поставить 100000 и перенести сессии php в редис, может что-то еще не учли? > > Дебаг-логи юнита включили, но ничего соотвествующего проблеме не увидели. Например, приведенное выше сообщение в логах nginx - первое за сегодня. Кусок лога unit за это время: > >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 h1p body rest: 0 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 http application handler >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 rpc: stream #23217 registered >> 2022/03/11 10:48:36.250 [debug] 244884#244901 mp 7F0600049E30 retain: 2 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_lock(55E27D377000) enter >> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_unlock(55E27D377000) exit >> 2022/03/11 10:48:36.250 [debug] 244884#244901 mp 7F0600049E30 retain: 3 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 request 1345 bytes shm buffer >> 2022/03/11 10:48:36.250 [debug] 244884#244901 mp 7F0600000BB0 retain: 25 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_lock(55E27D377138) enter >> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_unlock(55E27D377138) exit >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 outgoing mmap buf allocation: 7F0600028600 [7F06091F5000,16384] 244884->0,0,24 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 fields_count=13 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xE6EB, 0, 4, 7F0600049171 : 21 7F0600049177 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x7F29, 0, 15, 7F060004918E : 12 7F060004919F >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x25AB, 0, 10, 7F06000491AD : 5 7F06000491B9 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x1EA0, 0, 14, 7F06000491C0 : 3 7F06000491D0 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xA841, 0, 5, 7F06000491D5 : 1 7F06000491DC >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xB29A, 0, 13, 7F06000491DF : 42 7F06000491EE >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x0220, 0, 10, 7F060004921A : 145 7F0600049226 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xD871, 0, 6, 7F06000492B9 : 3 7F06000492C1 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x5F7D, 0, 12, 7F06000492C6 : 23 7F06000492D4 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xEDFF, 0, 12, 7F06000492ED : 36 7F06000492FB >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x23F2, 0, 6, 7F0600049321 : 277 7F0600049329 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x9683, 0, 15, 7F0600049440 : 13 7F0600049451 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xEA97, 0, 15, 7F0600049460 : 10 7F0600049471 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 about to send 1345 bytes buffer to app process port 12 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 queue is not empty >> 2022/03/11 10:48:36.250 [debug] 244884#244901 timer found minimum: 313989843±50:313748980 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 epoll_wait(36) timeout:240863 >> 2022/03/11 10:48:37.114 [debug] 244884#244901 epoll_wait(36): 1 >> 2022/03/11 10:48:37.114 [debug] 244884#244901 *22733 epoll: fd:17 ev:2001 d:7F060001D390 rd:2 wr:0 >> 2022/03/11 10:48:37.114 [debug] 244884#244901 timer expire minimum: 313989793:313749844 >> 2022/03/11 10:48:37.114 [debug] 244884#244901 timer found minimum: 313989843±50:313749844 >> 2022/03/11 10:48:37.114 [debug] 244884#244901 epoll_wait(36) timeout:239999 >> 2022/03/11 10:48:37.146 [debug] 244884#244901 epoll_wait(36): 1 >> 2022/03/11 10:48:37.146 [debug] 244884#244901 *22735 epoll: fd:19 ev:2001 d:7F06000029C0 rd:2 wr:0 >> 2022/03/11 10:48:37.146 [debug] 244884#244901 timer expire minimum: 313989793:313749876 >> 2022/03/11 10:48:37.146 [debug] 244884#244901 timer found minimum: 313989843±50:313749876 >> 2022/03/11 10:48:37.146 [debug] 244884#244901 epoll_wait(36) timeout:239967 >> 2022/03/11 10:48:37.190 [debug] 244884#244901 epoll_wait(36): 1 >> 2022/03/11 10:48:37.190 [debug] 244884#244901 *22736 epoll: fd:20 ev:2001 d:7F060000F710 rd:2 wr:0 >> 2022/03/11 10:48:37.190 [debug] 244884#244901 timer expire minimum: 313989793:313749920 >> 2022/03/11 10:48:37.190 [debug] 244884#244901 timer found minimum: 313989843±50:313749920 >> 2022/03/11 10:48:37.190 [debug] 244884#244901 epoll_wait(36) timeout:239923 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 epoll_wait(36): 1 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 epoll: fd:14 ev:0001 d:7F0600001430 rd:5 wr:0 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 timer expire minimum: 313989793:313756676 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: accept >> 2022/03/11 10:48:43.946 [debug] 244884#244901 accept4(14): 102 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 client: 127.0.0.1 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 malloc(168): 7F0600005F70 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 posix_memalign(16, 464): 7F060004B2E0 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22761 connections: 26 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: accept >> 2022/03/11 10:48:43.946 [debug] 244884#244901 accept4(14) (11: Resource temporarily unavailable) >> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: read >> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 http conn init >> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: read >> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 conn read fd:102 rdy:0 cl:0 er:0 bl:0 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 epoll 36 set event: fd:102 op:1 ev:80002001 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 timer add: 0±50 180000:313936676 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 timer change: 313936676±50:1 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 timers changes: 1 > > Конфиг unit'а: > >> { >> "settings": { >> "http": { >> "max_body_size": 10737418240, >> "body_read_timeout": 3600 >> } >> }, >> "listeners": { >> "127.0.0.1:8000": { >> "pass": "routes", >> "client_ip": { >> "header": "X-Forwarded-For", >> "source": [ >> "127.0.0.1" >> ] >> } >> } >> }, >> >> "routes": [ >> { >> "match": { >> "uri": [ >> "/thecloud/core/ajax/update.php*", >> "/thecloud/cron.php*", >> "/thecloud/index.php*", >> "/thecloud/ocm-provider*.php*", >> "/thecloud/ocs-provider*.php*", >> "/thecloud/ocs/v1.php*", >> "/thecloud/ocs/v2.php*", >> "/thecloud/public.php*", >> "/thecloud/remote.php*", >> "/thecloud/status.php*", >> "/thecloud/updater*.php*" >> ] >> }, >> >> "action": { >> "pass": "applications/nextcloud/direct" >> } >> }, >> { >> "match": { >> "uri": "/thecloud/ocm-provider*" >> }, >> >> "action": { >> "pass": "applications/nextcloud/ocm" >> } >> }, >> { >> "match": { >> "uri": "/thecloud/ocs-provider*" >> }, >> >> "action": { >> "pass": "applications/nextcloud/ocs" >> } >> }, >> { >> "match": { >> "uri": "/thecloud/updater*" >> }, >> >> "action": { >> "pass": "applications/nextcloud/updater" >> } >> }, >> { >> "match": { >> "uri": "/thecloud/*" >> }, >> "action": { >> "share": "/usr/local$uri", >> "fallback": { >> "pass": "applications/nextcloud/index" >> } >> } >> }, >> { >> "action": { >> "return": 403 >> } >> } >> ], >> >> "applications": { >> "nextcloud": { >> "user": "php-nextcloud", >> "group": "php-nextcloud", >> "limits": { >> "timeout": 300, >> "requests": 10000 >> }, >> "processes": { >> "max": 20, >> "spare": 10, >> "idle_timeout": 300 >> }, >> "options": { >> "admin": { >> "memory_limit": "512M", >> "post_max_size": "10G", >> "upload_max_filesize": "10G", >> "max_execution_time": "3600", >> "max_input_time": "3600" >> } >> }, >> "type": "php", >> "targets": { >> "direct": { >> "root": "/usr/local/" >> }, >> >> "index": { >> "root": "/usr/local/nextcloud/", >> "script": "index.php" >> }, >> >> "ocm": { >> "root": "/usr/local/nextcloud/ocm-provider/", >> "script": "index.php" >> }, >> >> "ocs": { >> "root": "/usr/local/nextcloud/ocs-provider/", >> "script": "index.php" >> }, >> >> "updater": { >> "root": "/usr/local/nextcloud/updater/", >> "script": "index.php" >> } >> } >> } >> } >> } > > Заранее спасибо! > > > С уважением, Иван. > > _______________________________________________ > unit mailing list -- unit at nginx.org > To unsubscribe send an email to unit-leave at nginx.org From viki2593 at hotmail.com Mon Mar 14 08:34:37 2022 From: viki2593 at hotmail.com (Victoria Pedrotti) Date: Mon, 14 Mar 2022 08:34:37 +0000 Subject: =?windows-1251?B?UmU6IHVuaXQg5+Di6PHg5fIg8SBwaHAgNy40IChuZ2lueCt1bml0K25l?= =?windows-1251?Q?xtcloud_=ED=E0_debian_11)?= In-Reply-To: <7D75FA2A-0C1F-4AB2-B473-6B37F3F6AA3C@nginx.com> References: <7D75FA2A-0C1F-4AB2-B473-6B37F3F6AA3C@nginx.com> Message-ID: Quien mierda sos?? Enviado desde mi smartphone Samsung Galaxy. -------- Mensaje original -------- De: Max Romanov Fecha: 14/3/22 5:01 (GMT-03:00) Para: unit at nginx.org Asunto: Re: unit зависает с php 7.4 (nginx+unit+nextcloud на debian 11) Здравствуйте, Иван. Похоже, что процессу 'unit: router' (pid 244884) не хватает файловых дескрипторов для принятия очередного клиентского соединения. Чтобы убедиться, что это так, можно посчитать кол-во используемых дескрипторов (напр. 'lsof -p 244884') и сравнить со значениями в строке 'Max open files' в /proc/244884/limits . Если кол-во дескрипторов маленькое на фоне 'Resource temporarily unavailable', то предположение неверное. Если кол-во дескрипторов большое, но существенно отличается от количества подключений, надо искать утечку дескрипторов в роутере (возможно, ошибка в Unit). Если кол-во используемых дескрипторов близко к предельному и (примерно) соответствует количеству клиентских соединений, то необходимо увеличить лимит. > > Мы уже выставили ему NoFiles = 10000, пробуем поставить 100000 и перенести сессии php в редис, может что-то еще не учли? > Направление похожее, но я не понял _где_ это выставлено. Повиляло ли это на /proc//limits ? Если нет - значит не та (или не там) настройка. — Max > On 11 Mar 2022, at 11:58, Иван wrote: > > Здравствуйте! > > > Перевели nextcloud (php) на unit. Периодически unit полностью перестаёт отвечать на запросы. В этот момент запрос к любому урлу с application nextcloud , обламывается по timeout. В логах nginx соотвественно > > 2022/03/11 10:48:37 [error] 156145#156145: *43083 upstream timed out (110: Connection timed out) while reading response header from upstre > am, client: 46.55, server: c.com, request: "GET /thecloud/ocs/v2.php/apps/activity/api/v2/activity?since=1883732&li > mit=50&format=json HTTP/1.1", upstream: "http://127.0.0.1:8000/thecloud/ocs/v2.php/apps/activity/api/v2/activity?since=1883732&limit=50&fo > rmat=json", host: "c.com" > > В логах unit вообще смущает > >> grep -c 'Resource temporarily unavailable' /var/log/unit.log >> 94542 > > Мы уже выставили ему NoFiles = 10000, пробуем поставить 100000 и перенести сессии php в редис, может что-то еще не учли? > > Дебаг-логи юнита включили, но ничего соотвествующего проблеме не увидели. Например, приведенное выше сообщение в логах nginx - первое за сегодня. Кусок лога unit за это время: > >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 h1p body rest: 0 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 http application handler >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 rpc: stream #23217 registered >> 2022/03/11 10:48:36.250 [debug] 244884#244901 mp 7F0600049E30 retain: 2 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_lock(55E27D377000) enter >> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_unlock(55E27D377000) exit >> 2022/03/11 10:48:36.250 [debug] 244884#244901 mp 7F0600049E30 retain: 3 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 request 1345 bytes shm buffer >> 2022/03/11 10:48:36.250 [debug] 244884#244901 mp 7F0600000BB0 retain: 25 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_lock(55E27D377138) enter >> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_unlock(55E27D377138) exit >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 outgoing mmap buf allocation: 7F0600028600 [7F06091F5000,16384] 244884->0,0,24 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 fields_count=13 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xE6EB, 0, 4, 7F0600049171 : 21 7F0600049177 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x7F29, 0, 15, 7F060004918E : 12 7F060004919F >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x25AB, 0, 10, 7F06000491AD : 5 7F06000491B9 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x1EA0, 0, 14, 7F06000491C0 : 3 7F06000491D0 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xA841, 0, 5, 7F06000491D5 : 1 7F06000491DC >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xB29A, 0, 13, 7F06000491DF : 42 7F06000491EE >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x0220, 0, 10, 7F060004921A : 145 7F0600049226 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xD871, 0, 6, 7F06000492B9 : 3 7F06000492C1 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x5F7D, 0, 12, 7F06000492C6 : 23 7F06000492D4 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xEDFF, 0, 12, 7F06000492ED : 36 7F06000492FB >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x23F2, 0, 6, 7F0600049321 : 277 7F0600049329 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x9683, 0, 15, 7F0600049440 : 13 7F0600049451 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xEA97, 0, 15, 7F0600049460 : 10 7F0600049471 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 about to send 1345 bytes buffer to app process port 12 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 queue is not empty >> 2022/03/11 10:48:36.250 [debug] 244884#244901 timer found minimum: 313989843±50:313748980 >> 2022/03/11 10:48:36.250 [debug] 244884#244901 epoll_wait(36) timeout:240863 >> 2022/03/11 10:48:37.114 [debug] 244884#244901 epoll_wait(36): 1 >> 2022/03/11 10:48:37.114 [debug] 244884#244901 *22733 epoll: fd:17 ev:2001 d:7F060001D390 rd:2 wr:0 >> 2022/03/11 10:48:37.114 [debug] 244884#244901 timer expire minimum: 313989793:313749844 >> 2022/03/11 10:48:37.114 [debug] 244884#244901 timer found minimum: 313989843±50:313749844 >> 2022/03/11 10:48:37.114 [debug] 244884#244901 epoll_wait(36) timeout:239999 >> 2022/03/11 10:48:37.146 [debug] 244884#244901 epoll_wait(36): 1 >> 2022/03/11 10:48:37.146 [debug] 244884#244901 *22735 epoll: fd:19 ev:2001 d:7F06000029C0 rd:2 wr:0 >> 2022/03/11 10:48:37.146 [debug] 244884#244901 timer expire minimum: 313989793:313749876 >> 2022/03/11 10:48:37.146 [debug] 244884#244901 timer found minimum: 313989843±50:313749876 >> 2022/03/11 10:48:37.146 [debug] 244884#244901 epoll_wait(36) timeout:239967 >> 2022/03/11 10:48:37.190 [debug] 244884#244901 epoll_wait(36): 1 >> 2022/03/11 10:48:37.190 [debug] 244884#244901 *22736 epoll: fd:20 ev:2001 d:7F060000F710 rd:2 wr:0 >> 2022/03/11 10:48:37.190 [debug] 244884#244901 timer expire minimum: 313989793:313749920 >> 2022/03/11 10:48:37.190 [debug] 244884#244901 timer found minimum: 313989843±50:313749920 >> 2022/03/11 10:48:37.190 [debug] 244884#244901 epoll_wait(36) timeout:239923 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 epoll_wait(36): 1 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 epoll: fd:14 ev:0001 d:7F0600001430 rd:5 wr:0 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 timer expire minimum: 313989793:313756676 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: accept >> 2022/03/11 10:48:43.946 [debug] 244884#244901 accept4(14): 102 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 client: 127.0.0.1 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 malloc(168): 7F0600005F70 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 posix_memalign(16, 464): 7F060004B2E0 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22761 connections: 26 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: accept >> 2022/03/11 10:48:43.946 [debug] 244884#244901 accept4(14) (11: Resource temporarily unavailable) >> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: read >> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 http conn init >> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: read >> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 conn read fd:102 rdy:0 cl:0 er:0 bl:0 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 epoll 36 set event: fd:102 op:1 ev:80002001 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 timer add: 0±50 180000:313936676 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 timer change: 313936676±50:1 >> 2022/03/11 10:48:43.946 [debug] 244884#244901 timers changes: 1 > > Конфиг unit'а: > >> { >> "settings": { >> "http": { >> "max_body_size": 10737418240, >> "body_read_timeout": 3600 >> } >> }, >> "listeners": { >> "127.0.0.1:8000": { >> "pass": "routes", >> "client_ip": { >> "header": "X-Forwarded-For", >> "source": [ >> "127.0.0.1" >> ] >> } >> } >> }, >> >> "routes": [ >> { >> "match": { >> "uri": [ >> "/thecloud/core/ajax/update.php*", >> "/thecloud/cron.php*", >> "/thecloud/index.php*", >> "/thecloud/ocm-provider*.php*", >> "/thecloud/ocs-provider*.php*", >> "/thecloud/ocs/v1.php*", >> "/thecloud/ocs/v2.php*", >> "/thecloud/public.php*", >> "/thecloud/remote.php*", >> "/thecloud/status.php*", >> "/thecloud/updater*.php*" >> ] >> }, >> >> "action": { >> "pass": "applications/nextcloud/direct" >> } >> }, >> { >> "match": { >> "uri": "/thecloud/ocm-provider*" >> }, >> >> "action": { >> "pass": "applications/nextcloud/ocm" >> } >> }, >> { >> "match": { >> "uri": "/thecloud/ocs-provider*" >> }, >> >> "action": { >> "pass": "applications/nextcloud/ocs" >> } >> }, >> { >> "match": { >> "uri": "/thecloud/updater*" >> }, >> >> "action": { >> "pass": "applications/nextcloud/updater" >> } >> }, >> { >> "match": { >> "uri": "/thecloud/*" >> }, >> "action": { >> "share": "/usr/local$uri", >> "fallback": { >> "pass": "applications/nextcloud/index" >> } >> } >> }, >> { >> "action": { >> "return": 403 >> } >> } >> ], >> >> "applications": { >> "nextcloud": { >> "user": "php-nextcloud", >> "group": "php-nextcloud", >> "limits": { >> "timeout": 300, >> "requests": 10000 >> }, >> "processes": { >> "max": 20, >> "spare": 10, >> "idle_timeout": 300 >> }, >> "options": { >> "admin": { >> "memory_limit": "512M", >> "post_max_size": "10G", >> "upload_max_filesize": "10G", >> "max_execution_time": "3600", >> "max_input_time": "3600" >> } >> }, >> "type": "php", >> "targets": { >> "direct": { >> "root": "/usr/local/" >> }, >> >> "index": { >> "root": "/usr/local/nextcloud/", >> "script": "index.php" >> }, >> >> "ocm": { >> "root": "/usr/local/nextcloud/ocm-provider/", >> "script": "index.php" >> }, >> >> "ocs": { >> "root": "/usr/local/nextcloud/ocs-provider/", >> "script": "index.php" >> }, >> >> "updater": { >> "root": "/usr/local/nextcloud/updater/", >> "script": "index.php" >> } >> } >> } >> } >> } > > Заранее спасибо! > > > С уважением, Иван. > > _______________________________________________ > unit mailing list -- unit at nginx.org > To unsubscribe send an email to unit-leave at nginx.org _______________________________________________ unit mailing list -- unit at nginx.org To unsubscribe send an email to unit-leave at nginx.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx at kinetiksoft.com Mon Mar 14 08:52:13 2022 From: nginx at kinetiksoft.com (=?UTF-8?B?0JjQstCw0L0=?=) Date: Mon, 14 Mar 2022 10:52:13 +0200 Subject: =?UTF-8?B?UmU6IHVuaXQg0LfQsNCy0LjRgdCw0LXRgiDRgSBwaHAgNy40IChuZ2lu?= =?UTF-8?Q?x+unit+nextcloud_=d0=bd=d0=b0_debian_11=29?= In-Reply-To: <7D75FA2A-0C1F-4AB2-B473-6B37F3F6AA3C@nginx.com> References: <7D75FA2A-0C1F-4AB2-B473-6B37F3F6AA3C@nginx.com> Message-ID: Здравствуйте! Поменяли вот так (для НЕдебаг так же): > # cat /etc/systemd/system/unit-debug.service.d/limits.conf > [Service] > LimitNOFILE=100000 > LimitCORE=infinity > # ps ax | grep -E 'unit.*router*' > 2975112 ?        Sl     0:08 unit: router > cat /proc/2975112/limits | grep 'Max open files' > Max open files            100000 100000               files Во время зависания мониторили как lsof ... | grep TCP, так и grep -v TCP так и просто, без grep. Даже близко к 100 тысяч не приближалось. На текущий момент предположили, что, в связи с серьезными изменениями в 1.26 в части пыхи, там ошибка в коде и откатились на 1.25. Пока без проблем, но и откатились недавно. Если скажете более конкретно какую информацию собирать, можем еще раз попробовать с 1.26.1 (если на 1.25 проблем не будет). С уважением, Иван. 14.03.2022 10:00, Max Romanov пишет: > Здравствуйте, Иван. > > Похоже, что процессу 'unit: router' (pid 244884) не хватает файловых дескрипторов для принятия очередного клиентского соединения. > > Чтобы убедиться, что это так, можно посчитать кол-во используемых дескрипторов (напр. 'lsof -p 244884') и сравнить со значениями в строке 'Max open files' в /proc/244884/limits . > > Если кол-во дескрипторов маленькое на фоне 'Resource temporarily unavailable', то предположение неверное. > Если кол-во дескрипторов большое, но существенно отличается от количества подключений, надо искать утечку дескрипторов в роутере (возможно, ошибка в Unit). > > Если кол-во используемых дескрипторов близко к предельному и (примерно) соответствует количеству клиентских соединений, то необходимо увеличить лимит. > >> Мы уже выставили ему NoFiles = 10000, пробуем поставить 100000 и перенести сессии php в редис, может что-то еще не учли? >> > > Направление похожее, но я не понял _где_ это выставлено. Повиляло ли это на /proc//limits ? Если нет - значит не та (или не там) настройка. > > — > Max > >> On 11 Mar 2022, at 11:58, Иван wrote: >> >> Здравствуйте! >> >> >> Перевели nextcloud (php) на unit. Периодически unit полностью перестаёт отвечать на запросы. В этот момент запрос к любому урлу с application nextcloud , обламывается по timeout. В логах nginx соотвественно >> >> 2022/03/11 10:48:37 [error] 156145#156145: *43083 upstream timed out (110: Connection timed out) while reading response header from upstre >> am, client: 46.55, server: c.com, request: "GET /thecloud/ocs/v2.php/apps/activity/api/v2/activity?since=1883732&li >> mit=50&format=json HTTP/1.1", upstream:"http://127.0.0.1:8000/thecloud/ocs/v2.php/apps/activity/api/v2/activity?since=1883732&limit=50&fo >> rmat=json", host: "c.com" >> >> В логах unit вообще смущает >> >>> grep -c 'Resource temporarily unavailable' /var/log/unit.log >>> 94542 >> Мы уже выставили ему NoFiles = 10000, пробуем поставить 100000 и перенести сессии php в редис, может что-то еще не учли? >> >> Дебаг-логи юнита включили, но ничего соотвествующего проблеме не увидели. Например, приведенное выше сообщение в логах nginx - первое за сегодня. Кусок лога unit за это время: >> >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 h1p body rest: 0 >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 http application handler >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 rpc: stream #23217 registered >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 mp 7F0600049E30 retain: 2 >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_lock(55E27D377000) enter >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_unlock(55E27D377000) exit >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 mp 7F0600049E30 retain: 3 >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 request 1345 bytes shm buffer >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 mp 7F0600000BB0 retain: 25 >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_lock(55E27D377138) enter >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_unlock(55E27D377138) exit >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 outgoing mmap buf allocation: 7F0600028600 [7F06091F5000,16384] 244884->0,0,24 >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 fields_count=13 >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xE6EB, 0, 4, 7F0600049171 : 21 7F0600049177 >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x7F29, 0, 15, 7F060004918E : 12 7F060004919F >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x25AB, 0, 10, 7F06000491AD : 5 7F06000491B9 >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x1EA0, 0, 14, 7F06000491C0 : 3 7F06000491D0 >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xA841, 0, 5, 7F06000491D5 : 1 7F06000491DC >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xB29A, 0, 13, 7F06000491DF : 42 7F06000491EE >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x0220, 0, 10, 7F060004921A : 145 7F0600049226 >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xD871, 0, 6, 7F06000492B9 : 3 7F06000492C1 >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x5F7D, 0, 12, 7F06000492C6 : 23 7F06000492D4 >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xEDFF, 0, 12, 7F06000492ED : 36 7F06000492FB >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x23F2, 0, 6, 7F0600049321 : 277 7F0600049329 >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x9683, 0, 15, 7F0600049440 : 13 7F0600049451 >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xEA97, 0, 15, 7F0600049460 : 10 7F0600049471 >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 about to send 1345 bytes buffer to app process port 12 >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 queue is not empty >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 timer found minimum: 313989843±50:313748980 >>> 2022/03/11 10:48:36.250 [debug] 244884#244901 epoll_wait(36) timeout:240863 >>> 2022/03/11 10:48:37.114 [debug] 244884#244901 epoll_wait(36): 1 >>> 2022/03/11 10:48:37.114 [debug] 244884#244901 *22733 epoll: fd:17 ev:2001 d:7F060001D390 rd:2 wr:0 >>> 2022/03/11 10:48:37.114 [debug] 244884#244901 timer expire minimum: 313989793:313749844 >>> 2022/03/11 10:48:37.114 [debug] 244884#244901 timer found minimum: 313989843±50:313749844 >>> 2022/03/11 10:48:37.114 [debug] 244884#244901 epoll_wait(36) timeout:239999 >>> 2022/03/11 10:48:37.146 [debug] 244884#244901 epoll_wait(36): 1 >>> 2022/03/11 10:48:37.146 [debug] 244884#244901 *22735 epoll: fd:19 ev:2001 d:7F06000029C0 rd:2 wr:0 >>> 2022/03/11 10:48:37.146 [debug] 244884#244901 timer expire minimum: 313989793:313749876 >>> 2022/03/11 10:48:37.146 [debug] 244884#244901 timer found minimum: 313989843±50:313749876 >>> 2022/03/11 10:48:37.146 [debug] 244884#244901 epoll_wait(36) timeout:239967 >>> 2022/03/11 10:48:37.190 [debug] 244884#244901 epoll_wait(36): 1 >>> 2022/03/11 10:48:37.190 [debug] 244884#244901 *22736 epoll: fd:20 ev:2001 d:7F060000F710 rd:2 wr:0 >>> 2022/03/11 10:48:37.190 [debug] 244884#244901 timer expire minimum: 313989793:313749920 >>> 2022/03/11 10:48:37.190 [debug] 244884#244901 timer found minimum: 313989843±50:313749920 >>> 2022/03/11 10:48:37.190 [debug] 244884#244901 epoll_wait(36) timeout:239923 >>> 2022/03/11 10:48:43.946 [debug] 244884#244901 epoll_wait(36): 1 >>> 2022/03/11 10:48:43.946 [debug] 244884#244901 epoll: fd:14 ev:0001 d:7F0600001430 rd:5 wr:0 >>> 2022/03/11 10:48:43.946 [debug] 244884#244901 timer expire minimum: 313989793:313756676 >>> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: accept >>> 2022/03/11 10:48:43.946 [debug] 244884#244901 accept4(14): 102 >>> 2022/03/11 10:48:43.946 [debug] 244884#244901 client: 127.0.0.1 >>> 2022/03/11 10:48:43.946 [debug] 244884#244901 malloc(168): 7F0600005F70 >>> 2022/03/11 10:48:43.946 [debug] 244884#244901 posix_memalign(16, 464): 7F060004B2E0 >>> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22761 connections: 26 >>> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: accept >>> 2022/03/11 10:48:43.946 [debug] 244884#244901 accept4(14) (11: Resource temporarily unavailable) >>> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: read >>> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 http conn init >>> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: read >>> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 conn read fd:102 rdy:0 cl:0 er:0 bl:0 >>> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 epoll 36 set event: fd:102 op:1 ev:80002001 >>> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 timer add: 0±50 180000:313936676 >>> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 timer change: 313936676±50:1 >>> 2022/03/11 10:48:43.946 [debug] 244884#244901 timers changes: 1 >> Конфиг unit'а: >> >>> { >>> "settings": { >>> "http": { >>> "max_body_size": 10737418240, >>> "body_read_timeout": 3600 >>> } >>> }, >>> "listeners": { >>> "127.0.0.1:8000": { >>> "pass": "routes", >>> "client_ip": { >>> "header": "X-Forwarded-For", >>> "source": [ >>> "127.0.0.1" >>> ] >>> } >>> } >>> }, >>> >>> "routes": [ >>> { >>> "match": { >>> "uri": [ >>> "/thecloud/core/ajax/update.php*", >>> "/thecloud/cron.php*", >>> "/thecloud/index.php*", >>> "/thecloud/ocm-provider*.php*", >>> "/thecloud/ocs-provider*.php*", >>> "/thecloud/ocs/v1.php*", >>> "/thecloud/ocs/v2.php*", >>> "/thecloud/public.php*", >>> "/thecloud/remote.php*", >>> "/thecloud/status.php*", >>> "/thecloud/updater*.php*" >>> ] >>> }, >>> >>> "action": { >>> "pass": "applications/nextcloud/direct" >>> } >>> }, >>> { >>> "match": { >>> "uri": "/thecloud/ocm-provider*" >>> }, >>> >>> "action": { >>> "pass": "applications/nextcloud/ocm" >>> } >>> }, >>> { >>> "match": { >>> "uri": "/thecloud/ocs-provider*" >>> }, >>> >>> "action": { >>> "pass": "applications/nextcloud/ocs" >>> } >>> }, >>> { >>> "match": { >>> "uri": "/thecloud/updater*" >>> }, >>> >>> "action": { >>> "pass": "applications/nextcloud/updater" >>> } >>> }, >>> { >>> "match": { >>> "uri": "/thecloud/*" >>> }, >>> "action": { >>> "share": "/usr/local$uri", >>> "fallback": { >>> "pass": "applications/nextcloud/index" >>> } >>> } >>> }, >>> { >>> "action": { >>> "return": 403 >>> } >>> } >>> ], >>> >>> "applications": { >>> "nextcloud": { >>> "user": "php-nextcloud", >>> "group": "php-nextcloud", >>> "limits": { >>> "timeout": 300, >>> "requests": 10000 >>> }, >>> "processes": { >>> "max": 20, >>> "spare": 10, >>> "idle_timeout": 300 >>> }, >>> "options": { >>> "admin": { >>> "memory_limit": "512M", >>> "post_max_size": "10G", >>> "upload_max_filesize": "10G", >>> "max_execution_time": "3600", >>> "max_input_time": "3600" >>> } >>> }, >>> "type": "php", >>> "targets": { >>> "direct": { >>> "root": "/usr/local/" >>> }, >>> >>> "index": { >>> "root": "/usr/local/nextcloud/", >>> "script": "index.php" >>> }, >>> >>> "ocm": { >>> "root": "/usr/local/nextcloud/ocm-provider/", >>> "script": "index.php" >>> }, >>> >>> "ocs": { >>> "root": "/usr/local/nextcloud/ocs-provider/", >>> "script": "index.php" >>> }, >>> >>> "updater": { >>> "root": "/usr/local/nextcloud/updater/", >>> "script": "index.php" >>> } >>> } >>> } >>> } >>> } >> Заранее спасибо! >> >> >> С уважением, Иван. >> >> _______________________________________________ >> unit mailing list --unit at nginx.org >> To unsubscribe send an email tounit-leave at nginx.org > _______________________________________________ > unit mailing list --unit at nginx.org > To unsubscribe send an email tounit-leave at nginx.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.romanov at nginx.com Mon Mar 14 14:21:51 2022 From: max.romanov at nginx.com (Max Romanov) Date: Mon, 14 Mar 2022 17:21:51 +0300 Subject: =?utf-8?B?UmU6IHVuaXQg0LfQsNCy0LjRgdCw0LXRgiDRgSBwaHAgNy40IChu?= =?utf-8?B?Z2lueCt1bml0K25leHRjbG91ZCDQvdCwIGRlYmlhbiAxMSk=?= In-Reply-To: References: <7D75FA2A-0C1F-4AB2-B473-6B37F3F6AA3C@nginx.com> Message-ID: <90ED0255-5C33-47E8-9DB7-A86BF58A6DA3@nginx.com> В самом деле, "Resource temporarily unavailable" - это безобидное сообщение. LimitNOFILE можно убирать :) Тогда предположение такое - ошибка (гонка) при остановке "idle" процессов. Как закончите эксперимент с 1.25 (результат интересен!), попробуйте зафиксировать кол-во процессов (напр. "processes": 10). — Max > On 14 Mar 2022, at 11:52, Иван wrote: > > Здравствуйте! > > Поменяли вот так (для НЕдебаг так же): > > >> # cat /etc/systemd/system/unit-debug.service.d/limits.conf >> [Service] >> LimitNOFILE=100000 >> LimitCORE=infinity > > > >> # ps ax | grep -E 'unit.*router*' >> 2975112 ? Sl 0:08 unit: router > > >> cat /proc/2975112/limits | grep 'Max open files' >> Max open files 100000 100000 files > > Во время зависания мониторили как lsof ... | grep TCP, так и grep -v TCP так и просто, без grep. Даже близко к 100 тысяч не приближалось. На текущий момент предположили, что, в связи с серьезными изменениями в 1.26 в части пыхи, там ошибка в коде и откатились на 1.25. Пока без проблем, но и откатились недавно. Если скажете более конкретно какую информацию собирать, можем еще раз попробовать с 1.26.1 (если на 1.25 проблем не будет). > > С уважением, Иван. > > 14.03.2022 10:00, Max Romanov пишет: >> Здравствуйте, Иван. >> >> Похоже, что процессу 'unit: router' (pid 244884) не хватает файловых дескрипторов для принятия очередного клиентского соединения. >> >> Чтобы убедиться, что это так, можно посчитать кол-во используемых дескрипторов (напр. 'lsof -p 244884') и сравнить со значениями в строке 'Max open files' в /proc/244884/limits . >> >> Если кол-во дескрипторов маленькое на фоне 'Resource temporarily unavailable', то предположение неверное. >> Если кол-во дескрипторов большое, но существенно отличается от количества подключений, надо искать утечку дескрипторов в роутере (возможно, ошибка в Unit). >> >> Если кол-во используемых дескрипторов близко к предельному и (примерно) соответствует количеству клиентских соединений, то необходимо увеличить лимит. >> >>> Мы уже выставили ему NoFiles = 10000, пробуем поставить 100000 и перенести сессии php в редис, может что-то еще не учли? >>> >> >> Направление похожее, но я не понял _где_ это выставлено. Повиляло ли это на /proc//limits ? Если нет - значит не та (или не там) настройка. >> >> — >> Max >> >>> On 11 Mar 2022, at 11:58, Иван wrote: >>> >>> Здравствуйте! >>> >>> >>> Перевели nextcloud (php) на unit. Периодически unit полностью перестаёт отвечать на запросы. В этот момент запрос к любому урлу с application nextcloud , обламывается по timeout. В логах nginx соотвественно >>> >>> 2022/03/11 10:48:37 [error] 156145#156145: *43083 upstream timed out (110: Connection timed out) while reading response header from upstre >>> am, client: 46.55, server: c.com, request: "GET /thecloud/ocs/v2.php/apps/activity/api/v2/activity?since=1883732&li >>> mit=50&format=json HTTP/1.1", upstream: "http://127.0.0.1:8000/thecloud/ocs/v2.php/apps/activity/api/v2/activity?since=1883732&limit=50&fo >>> rmat=json" , host: "c.com" >>> >>> В логах unit вообще смущает >>> >>>> grep -c 'Resource temporarily unavailable' /var/log/unit.log >>>> 94542 >>> Мы уже выставили ему NoFiles = 10000, пробуем поставить 100000 и перенести сессии php в редис, может что-то еще не учли? >>> >>> Дебаг-логи юнита включили, но ничего соотвествующего проблеме не увидели. Например, приведенное выше сообщение в логах nginx - первое за сегодня. Кусок лога unit за это время: >>> >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 h1p body rest: 0 >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 http application handler >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 rpc: stream #23217 registered >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 mp 7F0600049E30 retain: 2 >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_lock(55E27D377000) enter >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_unlock(55E27D377000) exit >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 mp 7F0600049E30 retain: 3 >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 request 1345 bytes shm buffer >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 mp 7F0600000BB0 retain: 25 >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_lock(55E27D377138) enter >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_unlock(55E27D377138) exit >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 outgoing mmap buf allocation: 7F0600028600 [7F06091F5000,16384] 244884->0,0,24 >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 fields_count=13 >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xE6EB, 0, 4, 7F0600049171 : 21 7F0600049177 >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x7F29, 0, 15, 7F060004918E : 12 7F060004919F >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x25AB, 0, 10, 7F06000491AD : 5 7F06000491B9 >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x1EA0, 0, 14, 7F06000491C0 : 3 7F06000491D0 >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xA841, 0, 5, 7F06000491D5 : 1 7F06000491DC >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xB29A, 0, 13, 7F06000491DF : 42 7F06000491EE >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x0220, 0, 10, 7F060004921A : 145 7F0600049226 >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xD871, 0, 6, 7F06000492B9 : 3 7F06000492C1 >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x5F7D, 0, 12, 7F06000492C6 : 23 7F06000492D4 >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xEDFF, 0, 12, 7F06000492ED : 36 7F06000492FB >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x23F2, 0, 6, 7F0600049321 : 277 7F0600049329 >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x9683, 0, 15, 7F0600049440 : 13 7F0600049451 >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xEA97, 0, 15, 7F0600049460 : 10 7F0600049471 >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 about to send 1345 bytes buffer to app process port 12 >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 queue is not empty >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 timer found minimum: 313989843±50:313748980 >>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 epoll_wait(36) timeout:240863 >>>> 2022/03/11 10:48:37.114 [debug] 244884#244901 epoll_wait(36): 1 >>>> 2022/03/11 10:48:37.114 [debug] 244884#244901 *22733 epoll: fd:17 ev:2001 d:7F060001D390 rd:2 wr:0 >>>> 2022/03/11 10:48:37.114 [debug] 244884#244901 timer expire minimum: 313989793:313749844 >>>> 2022/03/11 10:48:37.114 [debug] 244884#244901 timer found minimum: 313989843±50:313749844 >>>> 2022/03/11 10:48:37.114 [debug] 244884#244901 epoll_wait(36) timeout:239999 >>>> 2022/03/11 10:48:37.146 [debug] 244884#244901 epoll_wait(36): 1 >>>> 2022/03/11 10:48:37.146 [debug] 244884#244901 *22735 epoll: fd:19 ev:2001 d:7F06000029C0 rd:2 wr:0 >>>> 2022/03/11 10:48:37.146 [debug] 244884#244901 timer expire minimum: 313989793:313749876 >>>> 2022/03/11 10:48:37.146 [debug] 244884#244901 timer found minimum: 313989843±50:313749876 >>>> 2022/03/11 10:48:37.146 [debug] 244884#244901 epoll_wait(36) timeout:239967 >>>> 2022/03/11 10:48:37.190 [debug] 244884#244901 epoll_wait(36): 1 >>>> 2022/03/11 10:48:37.190 [debug] 244884#244901 *22736 epoll: fd:20 ev:2001 d:7F060000F710 rd:2 wr:0 >>>> 2022/03/11 10:48:37.190 [debug] 244884#244901 timer expire minimum: 313989793:313749920 >>>> 2022/03/11 10:48:37.190 [debug] 244884#244901 timer found minimum: 313989843±50:313749920 >>>> 2022/03/11 10:48:37.190 [debug] 244884#244901 epoll_wait(36) timeout:239923 >>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 epoll_wait(36): 1 >>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 epoll: fd:14 ev:0001 d:7F0600001430 rd:5 wr:0 >>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 timer expire minimum: 313989793:313756676 >>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: accept >>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 accept4(14): 102 >>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 client: 127.0.0.1 >>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 malloc(168): 7F0600005F70 >>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 posix_memalign(16, 464): 7F060004B2E0 >>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22761 connections: 26 >>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: accept >>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 accept4(14) (11: Resource temporarily unavailable) >>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: read >>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 http conn init >>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: read >>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 conn read fd:102 rdy:0 cl:0 er:0 bl:0 >>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 epoll 36 set event: fd:102 op:1 ev:80002001 >>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 timer add: 0±50 180000:313936676 >>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 timer change: 313936676±50:1 >>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 timers changes: 1 >>> Конфиг unit'а: >>> >>>> { >>>> "settings": { >>>> "http": { >>>> "max_body_size": 10737418240, >>>> "body_read_timeout": 3600 >>>> } >>>> }, >>>> "listeners": { >>>> "127.0.0.1:8000": { >>>> "pass": "routes", >>>> "client_ip": { >>>> "header": "X-Forwarded-For", >>>> "source": [ >>>> "127.0.0.1" >>>> ] >>>> } >>>> } >>>> }, >>>> >>>> "routes": [ >>>> { >>>> "match": { >>>> "uri": [ >>>> "/thecloud/core/ajax/update.php*", >>>> "/thecloud/cron.php*", >>>> "/thecloud/index.php*", >>>> "/thecloud/ocm-provider*.php*", >>>> "/thecloud/ocs-provider*.php*", >>>> "/thecloud/ocs/v1.php*", >>>> "/thecloud/ocs/v2.php*", >>>> "/thecloud/public.php*", >>>> "/thecloud/remote.php*", >>>> "/thecloud/status.php*", >>>> "/thecloud/updater*.php*" >>>> ] >>>> }, >>>> >>>> "action": { >>>> "pass": "applications/nextcloud/direct" >>>> } >>>> }, >>>> { >>>> "match": { >>>> "uri": "/thecloud/ocm-provider*" >>>> }, >>>> >>>> "action": { >>>> "pass": "applications/nextcloud/ocm" >>>> } >>>> }, >>>> { >>>> "match": { >>>> "uri": "/thecloud/ocs-provider*" >>>> }, >>>> >>>> "action": { >>>> "pass": "applications/nextcloud/ocs" >>>> } >>>> }, >>>> { >>>> "match": { >>>> "uri": "/thecloud/updater*" >>>> }, >>>> >>>> "action": { >>>> "pass": "applications/nextcloud/updater" >>>> } >>>> }, >>>> { >>>> "match": { >>>> "uri": "/thecloud/*" >>>> }, >>>> "action": { >>>> "share": "/usr/local$uri", >>>> "fallback": { >>>> "pass": "applications/nextcloud/index" >>>> } >>>> } >>>> }, >>>> { >>>> "action": { >>>> "return": 403 >>>> } >>>> } >>>> ], >>>> >>>> "applications": { >>>> "nextcloud": { >>>> "user": "php-nextcloud", >>>> "group": "php-nextcloud", >>>> "limits": { >>>> "timeout": 300, >>>> "requests": 10000 >>>> }, >>>> "processes": { >>>> "max": 20, >>>> "spare": 10, >>>> "idle_timeout": 300 >>>> }, >>>> "options": { >>>> "admin": { >>>> "memory_limit": "512M", >>>> "post_max_size": "10G", >>>> "upload_max_filesize": "10G", >>>> "max_execution_time": "3600", >>>> "max_input_time": "3600" >>>> } >>>> }, >>>> "type": "php", >>>> "targets": { >>>> "direct": { >>>> "root": "/usr/local/" >>>> }, >>>> >>>> "index": { >>>> "root": "/usr/local/nextcloud/", >>>> "script": "index.php" >>>> }, >>>> >>>> "ocm": { >>>> "root": "/usr/local/nextcloud/ocm-provider/", >>>> "script": "index.php" >>>> }, >>>> >>>> "ocs": { >>>> "root": "/usr/local/nextcloud/ocs-provider/", >>>> "script": "index.php" >>>> }, >>>> >>>> "updater": { >>>> "root": "/usr/local/nextcloud/updater/", >>>> "script": "index.php" >>>> } >>>> } >>>> } >>>> } >>>> } >>> Заранее спасибо! >>> >>> >>> С уважением, Иван. >>> >>> _______________________________________________ >>> unit mailing list -- unit at nginx.org >>> To unsubscribe send an email to unit-leave at nginx.org >> _______________________________________________ >> unit mailing list -- unit at nginx.org >> To unsubscribe send an email to unit-leave at nginx.org > _______________________________________________ > unit mailing list -- unit at nginx.org > To unsubscribe send an email to unit-leave at nginx.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx at kinetiksoft.com Tue Mar 15 15:33:16 2022 From: nginx at kinetiksoft.com (=?UTF-8?B?0JjQstCw0L0=?=) Date: Tue, 15 Mar 2022 17:33:16 +0200 Subject: =?UTF-8?B?UmU6IHVuaXQg0LfQsNCy0LjRgdCw0LXRgiDRgSBwaHAgNy40IChuZ2lu?= =?UTF-8?Q?x+unit+nextcloud_=d0=bd=d0=b0_debian_11=29?= In-Reply-To: <90ED0255-5C33-47E8-9DB7-A86BF58A6DA3@nginx.com> References: <7D75FA2A-0C1F-4AB2-B473-6B37F3F6AA3C@nginx.com> <90ED0255-5C33-47E8-9DB7-A86BF58A6DA3@nginx.com> Message-ID: <28bf6fac-2a26-0f6c-4a34-8cf92017e0ac@kinetiksoft.com> Здравствуйте! Еще не закончили, решили погонять до завтра, но предварительный результат: с unit-1.25 проблему не наблюдаем, за сутки ни одного таймаута. До этого 2-3 в сутки минимум. С уважением, Иван. 14.03.2022 16:21, Max Romanov пишет: > Как закончите эксперимент с 1.25 (результат интересен!) From ranier.vf at gmail.com Tue Mar 15 16:19:46 2022 From: ranier.vf at gmail.com (Ranier Vilela) Date: Tue, 15 Mar 2022 13:19:46 -0300 Subject: =?UTF-8?B?UmU6IHVuaXQg0LfQsNCy0LjRgdCw0LXRgiDRgSBwaHAgNy40IChuZ2lueCt1bml0K25leA==?= =?UTF-8?B?dGNsb3VkINC90LAgZGViaWFuIDExKQ==?= In-Reply-To: <28bf6fac-2a26-0f6c-4a34-8cf92017e0ac@kinetiksoft.com> References: <7D75FA2A-0C1F-4AB2-B473-6B37F3F6AA3C@nginx.com> <90ED0255-5C33-47E8-9DB7-A86BF58A6DA3@nginx.com> <28bf6fac-2a26-0f6c-4a34-8cf92017e0ac@kinetiksoft.com> Message-ID: STOP THE WAR! UKRAINE WE ARE WITH YOU! Em ter., 15 de mar. de 2022 às 12:33, Иван escreveu: > Здравствуйте! > > Еще не закончили, решили погонять до завтра, но предварительный > результат: с unit-1.25 проблему не наблюдаем, за сутки ни одного > таймаута. До этого 2-3 в сутки минимум. > > С уважением, Иван. > > 14.03.2022 16:21, Max Romanov пишет: > > Как закончите эксперимент с 1.25 (результат интересен!) > _______________________________________________ > unit mailing list -- unit at nginx.org > To unsubscribe send an email to unit-leave at nginx.org > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx at kinetiksoft.com Fri Mar 18 09:33:07 2022 From: nginx at kinetiksoft.com (=?UTF-8?B?0JjQstCw0L0=?=) Date: Fri, 18 Mar 2022 11:33:07 +0200 Subject: =?UTF-8?B?UmU6IHVuaXQg0LfQsNCy0LjRgdCw0LXRgiDRgSBwaHAgNy40IChuZ2lu?= =?UTF-8?Q?x+unit+nextcloud_=d0=bd=d0=b0_debian_11=29?= In-Reply-To: <90ED0255-5C33-47E8-9DB7-A86BF58A6DA3@nginx.com> References: <7D75FA2A-0C1F-4AB2-B473-6B37F3F6AA3C@nginx.com> <90ED0255-5C33-47E8-9DB7-A86BF58A6DA3@nginx.com> Message-ID: Здравствуйте! Столкнулись с подобной проблемой уже с руби (редмайн). Тоже динамическое количество потоков. Тоже unit 1.26.1. Заметили позже, так как сильно меньший rps. Будем сразу пробовать со статическим количество процессов. >        "applications": { >                "redmine": { >                        "type": "ruby", >                        "working_directory": "/usr/src/redmine", >                        "script": "config.ru", >                        "user": "redmine", >                        "group": "redmine", >                        "threads": 5, >                        "processes": 10, >                        "limits": { >                                "timeout": 30, >                                "requests": 5000 >                        }, > >                        "environment": { >                                "RAILS_ENV": "production" >                        } >                } >        } > С уважением, Иван. 14.03.2022 16:21, Max Romanov пишет: > Тогда предположение такое - ошибка (гонка) при остановке "idle" > процессов. Как закончите эксперимент с 1.25 (результат интересен!), > попробуйте зафиксировать кол-во процессов (напр. "processes": 10). -------------- next part -------------- An HTML attachment was scrubbed... URL: From scottvankalken at gmail.com Fri Mar 18 09:37:23 2022 From: scottvankalken at gmail.com (Scott van Kalken) Date: Fri, 18 Mar 2022 20:37:23 +1100 Subject: =?UTF-8?B?UmU6IHVuaXQg0LfQsNCy0LjRgdCw0LXRgiDRgSBwaHAgNy40IChuZ2lueCt1bml0K25leA==?= =?UTF-8?B?dGNsb3VkINC90LAgZGViaWFuIDExKQ==?= In-Reply-To: References: <7D75FA2A-0C1F-4AB2-B473-6B37F3F6AA3C@nginx.com> <90ED0255-5C33-47E8-9DB7-A86BF58A6DA3@nginx.com> Message-ID: Hey Ivan, If you get this working i’d be interested in the config. Scott On Fri, 18 Mar 2022 at 8:33 pm, Иван wrote: > Здравствуйте! > > Столкнулись с подобной проблемой уже с руби (редмайн). Тоже динамическое > количество потоков. Тоже unit 1.26.1. Заметили позже, так как сильно > меньший rps. Будем сразу пробовать со статическим количество процессов. > > "applications": { > "redmine": { > "type": "ruby", > "working_directory": "/usr/src/redmine", > "script": "config.ru", > "user": "redmine", > "group": "redmine", > "threads": 5, > "processes": 10, > "limits": { > "timeout": 30, > "requests": 5000 > }, > > "environment": { > "RAILS_ENV": "production" > } > } > } > > С уважением, Иван. > > 14.03.2022 16:21, Max Romanov пишет: > > Тогда предположение такое - ошибка (гонка) при остановке "idle" процессов. > Как закончите эксперимент с 1.25 (результат интересен!), попробуйте > зафиксировать кол-во процессов (напр. "processes": 10). > > _______________________________________________ > unit mailing list -- unit at nginx.org > To unsubscribe send an email to unit-leave at nginx.org > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kaystein92 at gmail.com Sat Mar 19 18:17:24 2022 From: kaystein92 at gmail.com (Kay Stein) Date: Sat, 19 Mar 2022 13:17:24 -0500 Subject: =?UTF-8?B?UmU6IHVuaXQg0LfQsNCy0LjRgdCw0LXRgiDRgSBwaHAgNy40IChuZ2lueCt1bml0K25leA==?= =?UTF-8?B?dGNsb3VkINC90LAgZGViaWFuIDExKQ==?= In-Reply-To: References: <7D75FA2A-0C1F-4AB2-B473-6B37F3F6AA3C@nginx.com> <90ED0255-5C33-47E8-9DB7-A86BF58A6DA3@nginx.com> Message-ID: Please unsubscribe me from your mailing list On Fri, Mar 18, 2022, 4:37 AM Scott van Kalken wrote: > Hey Ivan, > > If you get this working i’d be interested in the config. > > Scott > > On Fri, 18 Mar 2022 at 8:33 pm, Иван wrote: > >> Здравствуйте! >> >> Столкнулись с подобной проблемой уже с руби (редмайн). Тоже динамическое >> количество потоков. Тоже unit 1.26.1. Заметили позже, так как сильно >> меньший rps. Будем сразу пробовать со статическим количество процессов. >> >> "applications": { >> "redmine": { >> "type": "ruby", >> "working_directory": "/usr/src/redmine", >> "script": "config.ru", >> "user": "redmine", >> "group": "redmine", >> "threads": 5, >> "processes": 10, >> "limits": { >> "timeout": 30, >> "requests": 5000 >> }, >> >> "environment": { >> "RAILS_ENV": "production" >> } >> } >> } >> >> С уважением, Иван. >> >> 14.03.2022 16:21, Max Romanov пишет: >> >> Тогда предположение такое - ошибка (гонка) при остановке "idle" >> процессов. Как закончите эксперимент с 1.25 (результат интересен!), >> попробуйте зафиксировать кол-во процессов (напр. "processes": 10). >> >> _______________________________________________ >> unit mailing list -- unit at nginx.org >> To unsubscribe send an email to unit-leave at nginx.org >> > _______________________________________________ > unit mailing list -- unit at nginx.org > To unsubscribe send an email to unit-leave at nginx.org > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nginx at kinetiksoft.com Sun Mar 20 16:44:42 2022 From: nginx at kinetiksoft.com (=?UTF-8?B?0JjQstCw0L0=?=) Date: Sun, 20 Mar 2022 18:44:42 +0200 Subject: =?UTF-8?B?UmU6IHVuaXQg0LfQsNCy0LjRgdCw0LXRgiDRgSBwaHAgNy40IChuZ2lu?= =?UTF-8?Q?x+unit+nextcloud_=d0=bd=d0=b0_debian_11=29?= In-Reply-To: <90ED0255-5C33-47E8-9DB7-A86BF58A6DA3@nginx.com> References: <7D75FA2A-0C1F-4AB2-B473-6B37F3F6AA3C@nginx.com> <90ED0255-5C33-47E8-9DB7-A86BF58A6DA3@nginx.com> Message-ID: <8723d5ae-9c4c-6f2d-c915-2d1ccf23cc65@kinetiksoft.com> Здравствуйте! На unit 1.25 - не было ни одного "зависания" за несколько дней. Вчера обновились до 1.26.1 и поставили фиксированное количество процессов - 20, только за текущие сутки уже два зависания. Написал на баше вотчог, который перезапускает unit, если тот перестаёт отвечать по http. Готовы пробовать другие идеи, как мы можем помочь в поимке бага. Пишем дебаг-лог, но он, естественно, очень большой (за сутки порядка единиц гигабайт в несжатом виде)+содержит конфиденциальные данные, если он нужен, скажите, куда я могу приватно скинуть на него ссылку. С уважением, Иван. 14.03.2022 16:21, Max Romanov пишет: > В самом деле, "Resource temporarily unavailable" - это безобидное > сообщение. LimitNOFILE можно убирать :) > > Тогда предположение такое - ошибка (гонка) при остановке "idle" > процессов. Как закончите эксперимент с 1.25 (результат интересен!), > попробуйте зафиксировать кол-во процессов (напр. "processes": 10). > > — > Max > > >> On 14 Mar 2022, at 11:52, Иван wrote: >> >> Здравствуйте! >> >> Поменяли вот так (для НЕдебаг так же): >> >> >>> # cat /etc/systemd/system/unit-debug.service.d/limits.conf >>> [Service] >>> LimitNOFILE=100000 >>> LimitCORE=infinity >> >> >> >>> # ps ax | grep -E 'unit.*router*' >>> 2975112 ?        Sl     0:08 unit: router >> >> >>> cat /proc/2975112/limits | grep 'Max open files' >>> Max open files            100000 100000               files >> >> Во время зависания мониторили как lsof ... | grep TCP, так и grep -v >> TCP так и просто, без grep. Даже близко к 100 тысяч не приближалось. >> На текущий момент предположили, что, в связи с серьезными изменениями >> в 1.26 в части пыхи, там ошибка в коде и откатились на 1.25. Пока без >> проблем, но и откатились недавно. Если скажете более конкретно какую >> информацию собирать, можем еще раз попробовать с 1.26.1 (если на 1.25 >> проблем не будет). >> >> С уважением, Иван. >> >> 14.03.2022 10:00, Max Romanov пишет: >>> Здравствуйте, Иван. >>> >>> Похоже, что процессу 'unit: router' (pid 244884) не хватает файловых дескрипторов для принятия очередного клиентского соединения. >>> >>> Чтобы убедиться, что это так, можно посчитать кол-во используемых дескрипторов (напр. 'lsof -p 244884') и сравнить со значениями в строке 'Max open files' в /proc/244884/limits . >>> >>> Если кол-во дескрипторов маленькое на фоне 'Resource temporarily unavailable', то предположение неверное. >>> Если кол-во дескрипторов большое, но существенно отличается от количества подключений, надо искать утечку дескрипторов в роутере (возможно, ошибка в Unit). >>> >>> Если кол-во используемых дескрипторов близко к предельному и (примерно) соответствует количеству клиентских соединений, то необходимо увеличить лимит. >>> >>>> Мы уже выставили ему NoFiles = 10000, пробуем поставить 100000 и перенести сессии php в редис, может что-то еще не учли? >>>> >>> Направление похожее, но я не понял _где_ это выставлено. Повиляло ли это на /proc//limits ? Если нет - значит не та (или не там) настройка. >>> >>> — >>> Max >>> >>>> On 11 Mar 2022, at 11:58, Иван wrote: >>>> >>>> Здравствуйте! >>>> >>>> >>>> Перевели nextcloud (php) на unit. Периодически unit полностью перестаёт отвечать на запросы. В этот момент запрос к любому урлу с application nextcloud , обламывается по timeout. В логах nginx соотвественно >>>> >>>> 2022/03/11 10:48:37 [error] 156145#156145: *43083 upstream timed out (110: Connection timed out) while reading response header from upstre >>>> am, client: 46.55, server:c.com , request: "GET /thecloud/ocs/v2.php/apps/activity/api/v2/activity?since=1883732&li >>>> mit=50&format=json HTTP/1.1", upstream:"http://127.0.0.1:8000/thecloud/ocs/v2.php/apps/activity/api/v2/activity?since=1883732&limit=50&fo >>>> rmat=json", host: "c.com " >>>> >>>> В логах unit вообще смущает >>>> >>>>> grep -c 'Resource temporarily unavailable' /var/log/unit.log >>>>> 94542 >>>> Мы уже выставили ему NoFiles = 10000, пробуем поставить 100000 и перенести сессии php в редис, может что-то еще не учли? >>>> >>>> Дебаг-логи юнита включили, но ничего соотвествующего проблеме не увидели. Например, приведенное выше сообщение в логах nginx - первое за сегодня. Кусок лога unit за это время: >>>> >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 h1p body rest: 0 >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 http application handler >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 rpc: stream #23217 registered >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 mp 7F0600049E30 retain: 2 >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_lock(55E27D377000) enter >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_unlock(55E27D377000) exit >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 mp 7F0600049E30 retain: 3 >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 request 1345 bytes shm buffer >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 mp 7F0600000BB0 retain: 25 >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_lock(55E27D377138) enter >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 pthread_mutex_unlock(55E27D377138) exit >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 outgoing mmap buf allocation: 7F0600028600 [7F06091F5000,16384] 244884->0,0,24 >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 fields_count=13 >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xE6EB, 0, 4, 7F0600049171 : 21 7F0600049177 >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x7F29, 0, 15, 7F060004918E : 12 7F060004919F >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x25AB, 0, 10, 7F06000491AD : 5 7F06000491B9 >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x1EA0, 0, 14, 7F06000491C0 : 3 7F06000491D0 >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xA841, 0, 5, 7F06000491D5 : 1 7F06000491DC >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xB29A, 0, 13, 7F06000491DF : 42 7F06000491EE >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x0220, 0, 10, 7F060004921A : 145 7F0600049226 >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xD871, 0, 6, 7F06000492B9 : 3 7F06000492C1 >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x5F7D, 0, 12, 7F06000492C6 : 23 7F06000492D4 >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xEDFF, 0, 12, 7F06000492ED : 36 7F06000492FB >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x23F2, 0, 6, 7F0600049321 : 277 7F0600049329 >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0x9683, 0, 15, 7F0600049440 : 13 7F0600049451 >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 add field 0xEA97, 0, 15, 7F0600049460 : 10 7F0600049471 >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 about to send 1345 bytes buffer to app process port 12 >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 *22759 queue is not empty >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 timer found minimum: 313989843±50:313748980 >>>>> 2022/03/11 10:48:36.250 [debug] 244884#244901 epoll_wait(36) timeout:240863 >>>>> 2022/03/11 10:48:37.114 [debug] 244884#244901 epoll_wait(36): 1 >>>>> 2022/03/11 10:48:37.114 [debug] 244884#244901 *22733 epoll: fd:17 ev:2001 d:7F060001D390 rd:2 wr:0 >>>>> 2022/03/11 10:48:37.114 [debug] 244884#244901 timer expire minimum: 313989793:313749844 >>>>> 2022/03/11 10:48:37.114 [debug] 244884#244901 timer found minimum: 313989843±50:313749844 >>>>> 2022/03/11 10:48:37.114 [debug] 244884#244901 epoll_wait(36) timeout:239999 >>>>> 2022/03/11 10:48:37.146 [debug] 244884#244901 epoll_wait(36): 1 >>>>> 2022/03/11 10:48:37.146 [debug] 244884#244901 *22735 epoll: fd:19 ev:2001 d:7F06000029C0 rd:2 wr:0 >>>>> 2022/03/11 10:48:37.146 [debug] 244884#244901 timer expire minimum: 313989793:313749876 >>>>> 2022/03/11 10:48:37.146 [debug] 244884#244901 timer found minimum: 313989843±50:313749876 >>>>> 2022/03/11 10:48:37.146 [debug] 244884#244901 epoll_wait(36) timeout:239967 >>>>> 2022/03/11 10:48:37.190 [debug] 244884#244901 epoll_wait(36): 1 >>>>> 2022/03/11 10:48:37.190 [debug] 244884#244901 *22736 epoll: fd:20 ev:2001 d:7F060000F710 rd:2 wr:0 >>>>> 2022/03/11 10:48:37.190 [debug] 244884#244901 timer expire minimum: 313989793:313749920 >>>>> 2022/03/11 10:48:37.190 [debug] 244884#244901 timer found minimum: 313989843±50:313749920 >>>>> 2022/03/11 10:48:37.190 [debug] 244884#244901 epoll_wait(36) timeout:239923 >>>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 epoll_wait(36): 1 >>>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 epoll: fd:14 ev:0001 d:7F0600001430 rd:5 wr:0 >>>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 timer expire minimum: 313989793:313756676 >>>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: accept >>>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 accept4(14): 102 >>>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 client: 127.0.0.1 >>>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 malloc(168): 7F0600005F70 >>>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 posix_memalign(16, 464): 7F060004B2E0 >>>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22761 connections: 26 >>>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: accept >>>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 accept4(14) (11: Resource temporarily unavailable) >>>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: read >>>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 http conn init >>>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 work queue: read >>>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 conn read fd:102 rdy:0 cl:0 er:0 bl:0 >>>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 epoll 36 set event: fd:102 op:1 ev:80002001 >>>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 timer add: 0±50 180000:313936676 >>>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 *22760 timer change: 313936676±50:1 >>>>> 2022/03/11 10:48:43.946 [debug] 244884#244901 timers changes: 1 >>>> Конфиг unit'а: >>>> >>>>> { >>>>> "settings": { >>>>> "http": { >>>>> "max_body_size": 10737418240, >>>>> "body_read_timeout": 3600 >>>>> } >>>>> }, >>>>> "listeners": { >>>>> "127.0.0.1:8000": { >>>>> "pass": "routes", >>>>> "client_ip": { >>>>> "header": "X-Forwarded-For", >>>>> "source": [ >>>>> "127.0.0.1" >>>>> ] >>>>> } >>>>> } >>>>> }, >>>>> >>>>> "routes": [ >>>>> { >>>>> "match": { >>>>> "uri": [ >>>>> "/thecloud/core/ajax/update.php*", >>>>> "/thecloud/cron.php*", >>>>> "/thecloud/index.php*", >>>>> "/thecloud/ocm-provider*.php*", >>>>> "/thecloud/ocs-provider*.php*", >>>>> "/thecloud/ocs/v1.php*", >>>>> "/thecloud/ocs/v2.php*", >>>>> "/thecloud/public.php*", >>>>> "/thecloud/remote.php*", >>>>> "/thecloud/status.php*", >>>>> "/thecloud/updater*.php*" >>>>> ] >>>>> }, >>>>> >>>>> "action": { >>>>> "pass": "applications/nextcloud/direct" >>>>> } >>>>> }, >>>>> { >>>>> "match": { >>>>> "uri": "/thecloud/ocm-provider*" >>>>> }, >>>>> >>>>> "action": { >>>>> "pass": "applications/nextcloud/ocm" >>>>> } >>>>> }, >>>>> { >>>>> "match": { >>>>> "uri": "/thecloud/ocs-provider*" >>>>> }, >>>>> >>>>> "action": { >>>>> "pass": "applications/nextcloud/ocs" >>>>> } >>>>> }, >>>>> { >>>>> "match": { >>>>> "uri": "/thecloud/updater*" >>>>> }, >>>>> >>>>> "action": { >>>>> "pass": "applications/nextcloud/updater" >>>>> } >>>>> }, >>>>> { >>>>> "match": { >>>>> "uri": "/thecloud/*" >>>>> }, >>>>> "action": { >>>>> "share": "/usr/local$uri", >>>>> "fallback": { >>>>> "pass": "applications/nextcloud/index" >>>>> } >>>>> } >>>>> }, >>>>> { >>>>> "action": { >>>>> "return": 403 >>>>> } >>>>> } >>>>> ], >>>>> >>>>> "applications": { >>>>> "nextcloud": { >>>>> "user": "php-nextcloud", >>>>> "group": "php-nextcloud", >>>>> "limits": { >>>>> "timeout": 300, >>>>> "requests": 10000 >>>>> }, >>>>> "processes": { >>>>> "max": 20, >>>>> "spare": 10, >>>>> "idle_timeout": 300 >>>>> }, >>>>> "options": { >>>>> "admin": { >>>>> "memory_limit": "512M", >>>>> "post_max_size": "10G", >>>>> "upload_max_filesize": "10G", >>>>> "max_execution_time": "3600", >>>>> "max_input_time": "3600" >>>>> } >>>>> }, >>>>> "type": "php", >>>>> "targets": { >>>>> "direct": { >>>>> "root": "/usr/local/" >>>>> }, >>>>> >>>>> "index": { >>>>> "root": "/usr/local/nextcloud/", >>>>> "script": "index.php" >>>>> }, >>>>> >>>>> "ocm": { >>>>> "root": "/usr/local/nextcloud/ocm-provider/", >>>>> "script": "index.php" >>>>> }, >>>>> >>>>> "ocs": { >>>>> "root": "/usr/local/nextcloud/ocs-provider/", >>>>> "script": "index.php" >>>>> }, >>>>> >>>>> "updater": { >>>>> "root": "/usr/local/nextcloud/updater/", >>>>> "script": "index.php" >>>>> } >>>>> } >>>>> } >>>>> } >>>>> } >>>> Заранее спасибо! >>>> >>>> >>>> С уважением, Иван. >>>> >>>> _______________________________________________ >>>> unit mailing list --unit at nginx.org >>>> To unsubscribe send an email tounit-leave at nginx.org >>> _______________________________________________ >>> unit mailing list --unit at nginx.org >>> To unsubscribe send an email tounit-leave at nginx.org >> _______________________________________________ >> unit mailing list -- unit at nginx.org >> To unsubscribe send an email to unit-leave at nginx.org > > > _______________________________________________ > unit mailing list --unit at nginx.org > To unsubscribe send an email tounit-leave at nginx.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From alx.manpages at gmail.com Mon Mar 28 18:27:08 2022 From: alx.manpages at gmail.com (Alejandro Colomar) Date: Mon, 28 Mar 2022 20:27:08 +0200 Subject: [PATCH] uri.7: The term URL is deprecated, in favor of URI Message-ID: <20220328182707.6935-1-alx.manpages@gmail.com> See RFCs 4395 (obsoleted by 7595) and 7595. So, since URI and URL have been used as synonims and it wasn't clear to most people what the difference was, the RFCs seem to have explicitly avoided URL, and now use URI as the only term, which still means what it meant (so now URL is just a synonim for URI). This commit replaces (almost all) occurences of URL by URI, except when it is referring to the old term itself. Keep some legacy info just for readers to understand this. Cc: NGINX Unit Cc: Jakub Wilk Signed-off-by: Alejandro Colomar --- man7/uri.7 | 101 +++++++++++++++++++++++++++-------------------------- 1 file changed, 52 insertions(+), 49 deletions(-) diff --git a/man7/uri.7 b/man7/uri.7 index e9cfd4654..50121b24e 100644 --- a/man7/uri.7 +++ b/man7/uri.7 @@ -51,20 +51,23 @@ relative_path = relative_segment [ absolute_path ] .SH DESCRIPTION A Uniform Resource Identifier (URI) is a short string of characters identifying an abstract or physical resource (for example, a web page). -A Uniform Resource Locator (URL) is a URI -that identifies a resource through its primary access -mechanism (e.g., its network "location"), rather than -by name or some other attribute of that resource. -A Uniform Resource Name (URN) is a URI -that must remain globally unique and persistent even when -the resource ceases to exist or becomes unavailable. +It normally identifies a resource through its primary access +mechanism (e.g., its network "location"). +.PP +Uniform Resource Locator (URL) +used to refer to a subset of URIs, +but since the distinction is not easy, +the term has been superseeded by URI +and can be understood as a synonim of URI. +.PP +A Uniform Resource Name (URN) is a URI that uses the urn: scheme, +and must remain globally unique and persistent +even when the resource ceases to exist or becomes unavailable. .PP URIs are the standard way to name hypertext link destinations for tools such as web browsers. -The string "http://www.kernel.org" is a URL (and thus it -is also a URI). -Many people use the term URL loosely as a synonym for URI -(though technically URLs are a subset of URIs). +The string "http://www.kernel.org" is a URI. +Many people use the term URL loosely as a synonym for URI. .PP URIs can be absolute or relative. An absolute identifier refers to a resource independent of @@ -89,7 +92,7 @@ A URI beginning with \(aq#\(aq refers to that fragment in the current resource. There are many different URI schemes, each with specific additional rules and meanings, but they are intentionally made to be as similar as possible. -For example, many URL schemes +For example, many URI schemes permit the authority to be the following format, called here an .I ip_server (square brackets show what's optional): @@ -108,8 +111,8 @@ logs into a web server on host example.com as fred (using fredpassword) using port 8080. Avoid including a password in a URI if possible because of the many security risks of having a password written down. -If the URL supplies a username but no password, and the remote -server requests a password, the program interpreting the URL +If the URI supplies a username but no password, and the remote +server requests a password, the program interpreting the URI should request one from the user. .PP Here are some of the most common schemes in use on UNIX-like systems @@ -123,7 +126,7 @@ schemes; see those tools' documentation for information on those schemes. .br .RI http:// ip_server / path ? query .PP -This is a URL accessing a web (HTTP) server. +This is a URI accessing a web (HTTP) server. The default port is 80. If the path refers to a directory, the web server will choose what to return; usually if there is a file named "index.html" or "index.htm" @@ -158,7 +161,7 @@ for more information. .PP .RI ftp:// ip_server / path .PP -This is a URL accessing a file through the file transfer protocol (FTP). +This is a URI accessing a file through the file transfer protocol (FTP). The default port (for control) is 21. If no username is included, the username "anonymous" is supplied, and in that case many clients provide as the password the requestor's @@ -179,7 +182,7 @@ The default gopher port is 70. .I gophertype is a single-character field to denote the Gopher type of the resource to -which the URL refers. +which the URI refers. The entire path may also be empty, in which case the delimiting "/" is also optional and the gophertype defaults to "1". @@ -233,7 +236,7 @@ presence of the "@" character. .PP .RI telnet:// ip_server / .PP -The Telnet URL scheme is used to designate interactive text services that +The Telnet URI scheme is used to designate interactive text services that may be accessed by the Telnet protocol. The final "/" character may be omitted. The default port is 23. @@ -249,12 +252,12 @@ This represents a file or directory accessible locally. As a special case, .I ip_server can be the string "localhost" or the empty -string; this is interpreted as "the machine from which the URL is +string; this is interpreted as "the machine from which the URI is being interpreted". If the path is to a directory, the viewer should display the directory's contents with links to each containee; not all viewers currently do this. -KDE supports generated files through the URL . +KDE supports generated files through the URI . If the given file isn't found, browser writers may want to try to expand the filename via filename globbing (see @@ -363,8 +366,8 @@ See .UR http://www.ietf.org\:/rfc\:/rfc2255.txt RFC\ 2255 .UE -for more information on the LDAP URL scheme. -The components of this URL are: +for more information on the LDAP URI scheme. +The components of this URI are: .IP hostport 12 the LDAP server to query, written as a hostname optionally followed by a colon and the port number. @@ -509,8 +512,8 @@ A URI is always shown in its "escaped" form. Unreserved characters can be escaped without changing the semantics of the URI, but this should not be done unless the URI is being used in a context that does not allow the unescaped character to appear. -For example, "%7e" is sometimes used instead of "\(ti" in an HTTP URL -path, but the two are equivalent for an HTTP URL. +For example, "%7e" is sometimes used instead of "\(ti" in an HTTP URI +path, but the two are equivalent for an HTTP URI. .PP For URIs which must handle characters outside the US ASCII character set, the HTML 4.01 specification (section B.2) and @@ -556,7 +559,7 @@ to have a prefix of "ftp://"). Many client implementations heuristically resolve these references. Such heuristics may change over time, particularly when new schemes are introduced. -Since an abbreviated URI has the same syntax as a relative URL path, +Since an abbreviated URI has the same syntax as a relative URI path, abbreviated URI references cannot be used where relative URIs are permitted, and can be used only when there is no defined base (such as in dialog boxes). @@ -578,7 +581,7 @@ fine and in fact encouraged. .PP Technically the fragment isn't part of the URI. .PP -For information on how to embed URIs (including URLs) in a data format, +For information on how to embed URIs in a data format, see documentation on that format. HTML uses the format .I text @@ -609,32 +612,32 @@ version of this man page will describe the converged result. Efforts to aid this convergence are encouraged. .SS Security A URI does not in itself pose a security threat. -There is no general guarantee that a URL, which at one time -located a given resource, will continue to do so. -Nor is there any -guarantee that a URL will not locate a different resource at some -later point in time; such a guarantee can be -obtained only from the person(s) controlling that namespace and the -resource in question. -.PP -It is sometimes possible to construct a URL such that an attempt to -perform a seemingly harmless operation, such as the -retrieval of an entity associated with the resource, will in fact -cause a possibly damaging remote operation to occur. -The unsafe URL -is typically constructed by specifying a port number other than that +There is no general guarantee that a URI, +which at one time located a given resource, +will continue to do so. +Nor is there any guarantee that a URI +will not locate a different resource at some later point in time; +such a guarantee can be obtained only from +the person(s) controlling that namespace and the resource in question. +.PP +It is sometimes possible to construct a URI such that +an attempt to perform a seemingly harmless operation, +such as the retrieval of an entity associated with the resource, +will in fact cause a possibly damaging remote operation to occur. +The unsafe URI is typically constructed +by specifying a port number other than that reserved for the network protocol in question. The client unwittingly contacts a site that is in fact running a different protocol. -The content of the URL contains instructions that, when -interpreted according to this other protocol, cause an unexpected -operation. -An example has been the use of a gopher URL to cause an -unintended or impersonating message to be sent via a SMTP server. -.PP -Caution should be used when using any URL that specifies a port -number other than the default for the protocol, especially when it is -a number within the reserved space. +The content of the URI contains instructions that, +when interpreted according to this other protocol, +cause an unexpected operation. +An example has been the use of a gopher URI to cause +an unintended or impersonating message to be sent via a SMTP server. +.PP +Caution should be used when using any URI that specifies +a port number other than the default for the protocol, +especially when it is a number within the reserved space. .PP Care should be taken when a URI contains escaped delimiters for a given protocol (for example, CR and LF characters for telnet -- 2.30.2 From alx.manpages at gmail.com Mon Mar 28 18:56:22 2022 From: alx.manpages at gmail.com (Alejandro Colomar) Date: Mon, 28 Mar 2022 20:56:22 +0200 Subject: [PATCH] uri.7: Update RFC reference (2718 -> 7595) Message-ID: <20220328185621.7650-1-alx.manpages@gmail.com> There's no significant change that affects this paragraph, so simply update the reference to the obsolete RFC, to refer to the current one. Cc: NGINX Unit Cc: Jakub Wilk Signed-off-by: Alejandro Colomar --- man7/uri.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man7/uri.7 b/man7/uri.7 index 50121b24e..a2401b0cf 100644 --- a/man7/uri.7 +++ b/man7/uri.7 @@ -517,7 +517,7 @@ path, but the two are equivalent for an HTTP URI. .PP For URIs which must handle characters outside the US ASCII character set, the HTML 4.01 specification (section B.2) and -IETF RFC\ 2718 (section 2.2.5) recommend the following approach: +IETF RFC\~7595 (section 3.6) recommend the following approach: .IP 1. 4 translate the character sequences into UTF-8 (IETF RFC\~3629)\(emsee .BR utf\-8 (7)\(emand -- 2.30.2 From alx.manpages at gmail.com Tue Mar 29 16:23:43 2022 From: alx.manpages at gmail.com (Alejandro Colomar (man-pages)) Date: Tue, 29 Mar 2022 18:23:43 +0200 Subject: [PATCH] uri.7: The term URL is deprecated, in favor of URI In-Reply-To: <20220328221557.njqx4jtbvrgv44lc@jwilk.net> References: <20220328182707.6935-1-alx.manpages@gmail.com> <20220328221557.njqx4jtbvrgv44lc@jwilk.net> Message-ID: <36b89bec-1def-e87c-5477-c87f2f0e48e9@gmail.com> Hi Jakub! On 3/29/22 00:15, Jakub Wilk wrote: > * Alejandro Colomar , 2022-03-28, 20:27: >> See RFCs 4395 (obsoleted by 7595) and 7595. >> >> So, since URI and URL have been used as synonims > > s/synonim/synonym/ (here and elsewhere) Oops. I always doubt when writing words with two y/i in them. I should run dict -m synonim or echo synonim synonym | spell before typing! :) > >> the RFCs seem to have explicitly avoided URL, and now use URI as the >> only term, which still means what it meant (so now URL is just a >> synonim for URI). > > No, as far as RFCs are concerned, URLs are a proper subset of URIs; they > are not synonyms. Hmmm, now I've read a few more RFCs, and it seems you're right. > >> This commit replaces (almost all) occurences of URL by URI, except >> when it is referring to the old term itself.  Keep some legacy info >> just for readers to understand this. > > I'm not sure this is a step in the right direction. As a data point, in > contrast to IETF, WHATWG standardized on the term "URL": > https://url.spec.whatwg.org/#goals As you say, it's not. I'm now more confused than I was before, so I will revert this change. If you feel like you could update the page, since you seem to know more than me in this regard, that would be great. Thanks for the review! Alex -- Alejandro Colomar Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/ http://www.alejandro-colomar.es/