From https://github.com/netbox-community/pynetbox#threading
pynetbox supports threading for .all() and .filter()
I gave it a try on netbox-dev with generate_dns_snippets.py as it contains a lot of .all() and .filter() and the performance improvement is there: 2m9s vs. 1m26s
See output on
1 | ayounsi@netbox-dev2002:~$ time /srv/deployment/netbox-extras/dns/generate_dns_snippets.py -v commit --icinga-check "icinga-check" |
---|---|
2 | 2022-06-28 08:35:42,798 [ERROR] /srv/deployment/netbox-extras/dns/generate_dns_snippets.py:655 Failed to read Icinga state from /var/run/netbox_generate_dns_snippets.state: [Errno 2] No such file or directory: '/var/run/netbox_generate_dns_snippets.state' |
3 | 2022-06-28 08:35:42,799 [INFO] /srv/deployment/netbox-extras/dns/generate_dns_snippets.py:148 Gathering devices, interfaces, addresses and prefixes from Netbox |
4 | 2022-06-28 08:35:42,801 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:973 Starting new HTTPS connection (1): netbox-next.wikimedia.org:443 |
5 | 2022-06-28 08:35:43,067 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/ip-addresses/?status=active HTTP/1.1" 200 29777 |
6 | 2022-06-28 08:35:47,574 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/ip-addresses/?status=active&limit=7439&offset=50 HTTP/1.1" 200 814970 |
7 | 2022-06-28 08:35:52,473 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/ip-addresses/?limit=1000&offset=1050&status=active HTTP/1.1" 200 845440 |
8 | 2022-06-28 08:35:56,915 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/ip-addresses/?limit=1000&offset=2050&status=active HTTP/1.1" 200 831506 |
9 | 2022-06-28 08:36:01,441 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/ip-addresses/?limit=1000&offset=3050&status=active HTTP/1.1" 200 836596 |
10 | 2022-06-28 08:36:06,021 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/ip-addresses/?limit=1000&offset=4050&status=active HTTP/1.1" 200 830870 |
11 | 2022-06-28 08:36:11,334 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/ip-addresses/?limit=1000&offset=5050&status=active HTTP/1.1" 200 854477 |
12 | 2022-06-28 08:36:16,047 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/ip-addresses/?limit=1000&offset=6050&status=active HTTP/1.1" 200 857400 |
13 | 2022-06-28 08:36:18,009 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/ip-addresses/?limit=1000&offset=7050&status=active HTTP/1.1" 200 333294 |
14 | 2022-06-28 08:36:19,789 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/ HTTP/1.1" 200 59475 |
15 | 2022-06-28 08:36:24,235 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?limit=15946&offset=50 HTTP/1.1" 200 1333793 |
16 | 2022-06-28 08:36:30,933 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?limit=1000&offset=1050 HTTP/1.1" 200 1630348 |
17 | 2022-06-28 08:36:37,277 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?limit=1000&offset=2050 HTTP/1.1" 200 1620694 |
18 | 2022-06-28 08:36:42,722 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?limit=1000&offset=3050 HTTP/1.1" 200 1467671 |
19 | 2022-06-28 08:36:48,038 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?limit=1000&offset=4050 HTTP/1.1" 200 1389995 |
20 | 2022-06-28 08:36:51,761 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?limit=1000&offset=5050 HTTP/1.1" 200 1223879 |
21 | 2022-06-28 08:36:55,678 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?limit=1000&offset=6050 HTTP/1.1" 200 1196143 |
22 | 2022-06-28 08:36:59,486 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?limit=1000&offset=7050 HTTP/1.1" 200 1176453 |
23 | 2022-06-28 08:37:03,788 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?limit=1000&offset=8050 HTTP/1.1" 200 1251809 |
24 | 2022-06-28 08:37:08,076 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?limit=1000&offset=9050 HTTP/1.1" 200 1231642 |
25 | 2022-06-28 08:37:10,585 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?limit=1000&offset=10050 HTTP/1.1" 200 1044202 |
26 | 2022-06-28 08:37:12,936 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?limit=1000&offset=11050 HTTP/1.1" 200 1044483 |
27 | 2022-06-28 08:37:15,447 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?limit=1000&offset=12050 HTTP/1.1" 200 1046171 |
28 | 2022-06-28 08:37:18,950 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?limit=1000&offset=13050 HTTP/1.1" 200 1171196 |
29 | 2022-06-28 08:37:22,712 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?limit=1000&offset=14050 HTTP/1.1" 200 1198189 |
30 | 2022-06-28 08:37:26,358 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?limit=1000&offset=15050 HTTP/1.1" 200 1060690 |
31 | 2022-06-28 08:37:30,023 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/virtualization/interfaces/ HTTP/1.1" 200 29166 |
32 | 2022-06-28 08:37:30,445 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/virtualization/interfaces/?limit=261&offset=50 HTTP/1.1" 200 122764 |
33 | 2022-06-28 08:37:30,624 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/prefixes/ HTTP/1.1" 200 34342 |
34 | 2022-06-28 08:37:31,077 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/prefixes/?limit=474&offset=50 HTTP/1.1" 200 284492 |
35 | 2022-06-28 08:37:31,713 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/devices/?status=active&status=planned&status=staged&status=failed&status=inventory&status=decommissioning HTTP/1.1" 200 105398 |
36 | 2022-06-28 08:37:34,562 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/devices/?status=active&status=planned&status=staged&status=failed&status=inventory&status=decommissioning&limit=2421&offset=50 HTTP/1.1" 200 2022656 |
37 | 2022-06-28 08:37:37,049 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/devices/?limit=1000&offset=1050&status=active&status=planned&status=staged&status=failed&status=inventory&status=decommissioning HTTP/1.1" 200 2024920 |
38 | 2022-06-28 08:37:39,698 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/devices/?limit=1000&offset=2050&status=active&status=planned&status=staged&status=failed&status=inventory&status=decommissioning HTTP/1.1" 200 690082 |
39 | [...] |
40 | 2022-06-28 08:37:41,278 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/virtualization/virtual-machines/ HTTP/1.1" 200 74472 |
41 | 2022-06-28 08:37:42,035 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/virtualization/virtual-machines/?limit=259&offset=50 HTTP/1.1" 200 310980 |
42 | |
43 | 2022-06-28 08:37:42,130 [ERROR] /srv/deployment/netbox-extras/dns/generate_dns_snippets.py:173 Unsupported assigned object type: ipam.fhrpgroup |
44 | [...] |
45 | 2022-06-28 08:37:51,817 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:973 Starting new HTTPS connection (1): netbox-next.wikimedia.org:443 |
46 | 2022-06-28 08:37:51,874 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/extras/object-changes/?time_after=2022-06-28+08%3A07%3A51.815910 HTTP/1.1" 200 52 |
47 | [...] |
48 | real 2m9.411s |
49 | user 0m14.902s |
50 | sys 0m0.847s |
51 | |
52 | |
53 | |
54 | ===================== |
55 | |
56 | |
57 | |
58 | ayounsi@netbox-dev2002:~$ time /srv/deployment/netbox-extras/dns/generate_dns_snippets.py -v commit --icinga-check "icinga-check" |
59 | 2022-06-28 08:39:44,240 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:973 Starting new HTTPS connection (1): netbox-next.wikimedia.org:443 |
60 | 2022-06-28 08:39:50,130 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/ip-addresses/?status=active&limit=0 HTTP/1.1" 200 802360 |
61 | 2022-06-28 08:39:50,160 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:973 Starting new HTTPS connection (2): netbox-next.wikimedia.org:443 |
62 | 2022-06-28 08:39:50,164 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:973 Starting new HTTPS connection (3): netbox-next.wikimedia.org:443 |
63 | 2022-06-28 08:39:50,174 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:973 Starting new HTTPS connection (4): netbox-next.wikimedia.org:443 |
64 | 2022-06-28 08:39:54,579 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/ip-addresses/?status=active&offset=1000&limit=1000 HTTP/1.1" 200 845621 |
65 | 2022-06-28 08:39:55,098 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/ip-addresses/?status=active&offset=3000&limit=1000 HTTP/1.1" 200 836719 |
66 | 2022-06-28 08:39:58,466 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/ip-addresses/?status=active&offset=4000&limit=1000 HTTP/1.1" 200 829758 |
67 | 2022-06-28 08:40:00,502 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/ip-addresses/?status=active&offset=2000&limit=1000 HTTP/1.1" 200 831853 |
68 | 2022-06-28 08:40:02,899 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/ip-addresses/?status=active&offset=5000&limit=1000 HTTP/1.1" 200 854450 |
69 | 2022-06-28 08:40:04,969 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/ip-addresses/?status=active&offset=7000&limit=1000 HTTP/1.1" 200 377338 |
70 | 2022-06-28 08:40:05,302 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/ip-addresses/?status=active&offset=6000&limit=1000 HTTP/1.1" 200 856001 |
71 | 2022-06-28 08:40:12,384 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?limit=0 HTTP/1.1" 200 1301453 |
72 | 2022-06-28 08:40:12,541 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:272 Resetting dropped connection: netbox-next.wikimedia.org |
73 | 2022-06-28 08:40:12,545 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:272 Resetting dropped connection: netbox-next.wikimedia.org |
74 | 2022-06-28 08:40:12,561 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:272 Resetting dropped connection: netbox-next.wikimedia.org |
75 | 2022-06-28 08:40:18,880 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?offset=2000&limit=1000 HTTP/1.1" 200 1626900 |
76 | 2022-06-28 08:40:19,470 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?offset=1000&limit=1000 HTTP/1.1" 200 1636174 |
77 | 2022-06-28 08:40:23,605 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?offset=4000&limit=1000 HTTP/1.1" 200 1387417 |
78 | 2022-06-28 08:40:26,209 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?offset=3000&limit=1000 HTTP/1.1" 200 1479487 |
79 | 2022-06-28 08:40:27,469 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?offset=5000&limit=1000 HTTP/1.1" 200 1235212 |
80 | 2022-06-28 08:40:30,657 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?offset=6000&limit=1000 HTTP/1.1" 200 1194842 |
81 | 2022-06-28 08:40:30,841 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?offset=7000&limit=1000 HTTP/1.1" 200 1172883 |
82 | 2022-06-28 08:40:34,895 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?offset=9000&limit=1000 HTTP/1.1" 200 1241527 |
83 | 2022-06-28 08:40:35,644 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?offset=8000&limit=1000 HTTP/1.1" 200 1253120 |
84 | 2022-06-28 08:40:37,159 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?offset=10000&limit=1000 HTTP/1.1" 200 1044726 |
85 | 2022-06-28 08:40:38,655 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?offset=11000&limit=1000 HTTP/1.1" 200 1044441 |
86 | 2022-06-28 08:40:39,503 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?offset=12000&limit=1000 HTTP/1.1" 200 1045453 |
87 | 2022-06-28 08:40:42,720 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?offset=13000&limit=1000 HTTP/1.1" 200 1163827 |
88 | 2022-06-28 08:40:43,069 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?offset=14000&limit=1000 HTTP/1.1" 200 1199744 |
89 | 2022-06-28 08:40:46,562 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/interfaces/?offset=15000&limit=1000 HTTP/1.1" 200 1119428 |
90 | 2022-06-28 08:40:51,734 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/virtualization/interfaces/?limit=0 HTTP/1.1" 200 151724 |
91 | 2022-06-28 08:40:52,269 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/ipam/prefixes/?limit=0 HTTP/1.1" 200 318652 |
92 | 2022-06-28 08:40:54,928 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/devices/?status=active&status=planned&status=staged&status=failed&status=inventory&status=decommissioning&limit=0 HTTP/1.1" 200 2032172 |
93 | 2022-06-28 08:40:54,971 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:272 Resetting dropped connection: netbox-next.wikimedia.org |
94 | 2022-06-28 08:40:56,193 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/devices/?status=active&status=planned&status=staged&status=failed&status=inventory&status=decommissioning&offset=2000&limit=1000 HTTP/1.1" 200 791553 |
95 | 2022-06-28 08:40:57,897 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/devices/?status=active&status=planned&status=staged&status=failed&status=inventory&status=decommissioning&offset=1000&limit=1000 HTTP/1.1" 200 2018945 |
96 | [...] |
97 | 2022-06-28 08:40:59,889 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/virtualization/virtual-machines/?limit=0 HTTP/1.1" 200 385234[...] |
98 | 2022-06-28 08:41:05,906 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:272 Resetting dropped connection: netbox-next.wikimedia.org |
99 | 2022-06-28 08:41:06,129 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/devices/2717/ HTTP/1.1" 200 2148 |
100 | 2022-06-28 08:41:06,360 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/devices/3572/ HTTP/1.1" 200 2175 |
101 | 2022-06-28 08:41:06,705 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/devices/4133/ HTTP/1.1" 200 2162 |
102 | 2022-06-28 08:41:06,934 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/devices/4125/ HTTP/1.1" 200 2203 |
103 | 2022-06-28 08:41:07,273 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/devices/2305/ HTTP/1.1" 200 2029 |
104 | 2022-06-28 08:41:07,546 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/dcim/devices/4124/ HTTP/1.1" 200 2198 |
105 | [...] |
106 | 2022-06-28 08:41:10,100 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:973 Starting new HTTPS connection (1): netbox-next.wikimedia.org:443 |
107 | 2022-06-28 08:41:10,194 [DEBUG] /usr/lib/python3/dist-packages/urllib3/connectionpool.py:452 https://netbox-next.wikimedia.org:443 "GET /api/extras/object-changes/?time_after=2022-06-28+08%3A11%3A10.099049&limit=0 HTTP/1.1" 200 52 |
108 | |
109 | real 1m26.328s |
110 | user 0m16.770s |
111 | sys 0m0.761s |
112 | |
113 |
Looking at the release notes on https://github.com/netbox-community/pynetbox/releases?q=thread&expanded=true
Even though it would works on 5.3.1 (previous target with T310745: Upgrade pynetbox) 6.1.1 fixes an issue that could be problematic.
So next steps:
- T310745: Upgrade pynetbox >= 6.1.1
- Enable threading on generate_dns_snippets.py
- Check the server side impact (rollback and re-asses if needed)
- Roll out to all the scripts and cookbooks
Note that it's a parallel effort to {T310577} but have the advantage of being a potential easy win (big impact, low cost).