环境变量数量对进程启动时间的影响

环境变量数量对进程启动时间的影响

我在启动一个进程之前导出了 30,000 个环境变量,我发现该进程的启动时间很长。

uruddarraju$ for i in {1..30000}; do export KUBE_SVC_${i}=443; export KUBE_SVC_HOST_$i=192.162.0.1; done;
uruddarraju$ time git clone https://****:[email protected]/uruddarraju/rnpcinode
-sh: /usr/bin/git: Argument list too long

real    0m25.038s
user    0m24.829s
sys     0m0.096s

编辑 1:没有环境变量

time git clone https://****:[email protected]/uruddarraju/node
Cloning into 'node'...
remote: Counting objects: 131, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 131 (delta 4), reused 0 (delta 0), pack-reused 122
Receiving objects: 100% (131/131), 126.46 KiB | 0 bytes/s, done.
Resolving deltas: 100% (26/26), done.

real    0m0.433s
user    0m0.059s
sys     0m0.075s

我想知道环境变量的数量将如何影响从开始到结束的进程完成时间。

相关内容