日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

git压测出现访问500

發(fā)布時間:2023/12/19 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 git压测出现访问500 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

git 啟動之后根據(jù)cpu的內核數(shù)據(jù)創(chuàng)建和內核數(shù)目相等的進程數(shù):

root 29694 29669 0 2017 ? 00:00:00 runsv redis root 29743 29669 0 2017 ? 00:00:00 runsv unicorn root 29744 29743 0 2017 ? 00:00:00 svlogd -tt /var/log/gitlab/unicorn root 29775 29669 0 2017 ? 00:00:00 runsv sidekiq root 29786 29669 0 2017 ? 00:00:00 runsv gitlab-workhorse root 29800 29669 0 2017 ? 00:00:00 runsv nginx root 29848 29669 0 2017 ? 00:00:00 runsv logrotate git 30489 29786 0 15:57 ? 00:00:02 /opt/gitlab/embedded/bin/gitlab-workhorse -listenNetwork unix -listenUmask 0 -listenAddr /var/opt/gitlab/gitlab-workhorse/socket -authBackend http://localhost:8080 -authSocket /var/opt/gitlab/gitlab-rails/sockets/gitlab.socket -documentRoot /opt/gitlab/embedded/service/gitlab-rails/public -pprofListenAddr -secretPath /opt/gitlab/embedded/service/gitlab-rails/.gitlab_workhorse_secret git 30551 29743 0 15:57 ? 00:00:01 /bin/bash /opt/gitlab/embedded/bin/gitlab-unicorn-wrapper git 30567 1 0 15:57 ? 00:00:14 unicorn master -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru git 30609 30567 0 15:58 ? 00:00:15 unicorn worker[0] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru git 30612 30567 0 15:58 ? 00:00:20 unicorn worker[1] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru git 30615 30567 0 15:58 ? 00:00:14 unicorn worker[2] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru git 30618 30567 0 15:58 ? 00:00:17 unicorn worker[3] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru git 30621 30567 0 15:58 ? 00:00:13 unicorn worker[4] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru git 30624 30567 0 15:58 ? 00:00:18 unicorn worker[5] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru git 30627 30567 0 15:58 ? 00:00:14 unicorn worker[6] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru git 30630 30567 0 15:58 ? 00:00:14 unicorn worker[7] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru git 30633 30567 0 15:58 ? 00:00:15 unicorn worker[8] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru

每一個git 任務過來就會放進一個進程里面去處理。

每一個git 進程就是一個unicorn(獨角獸),也可以理解成一個git rails(git 執(zhí)行軌道)。

并發(fā)的幾個線程,其中一個是master pid = 30567

其他的slave worker都是master 創(chuàng)建的,父進程id都是30567


/var/opt/gitlab/gitlab-rails/etc/unicorn.rb? ?文件:

# This file is managed by gitlab-ctl. Manual changes will be # erased! To change the contents below, edit /etc/gitlab/gitlab.rb # and run `sudo gitlab-ctl reconfigure`.# What ports/sockets to listen on, and what options for them. listen "127.0.0.1:8080", :tcp_nopush => true listen "/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket", :backlog => 1024working_directory '/var/opt/gitlab/gitlab-rails/working'# What the timeout for killing busy workers is, in seconds timeout 60# Whether the app should be pre-loaded preload_app true# How many worker processes worker_processes 9# What to do before we fork a worker before_fork do |server, worker|old_pid = "#{server.config[:pid]}.oldbin"if old_pid != server.pidbeginsig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOUProcess.kill(sig, File.read(old_pid).to_i)rescue Errno::ENOENT, Errno::ESRCHendendActiveRecord::Base.connection.disconnect! if defined?(ActiveRecord::Base)end# What to do after we fork a worker after_fork do |server, worker|ActiveRecord::Base.establish_connection if defined?(ActiveRecord::Base)end# Where to drop a pidfile pid '/opt/gitlab/var/unicorn/unicorn.pid'# Where stderr gets logged stderr_path '/var/log/gitlab/unicorn/unicorn_stderr.log'# Where stdout gets logged stdout_path '/var/log/gitlab/unicorn/unicorn_stdout.log'# Min memory size (RSS) per worker ENV['GITLAB_UNICORN_MEMORY_MIN'] = (400 * 1 << 20).to_s# Max memory size (RSS) per worker ENV['GITLAB_UNICORN_MEMORY_MAX'] = (650 * 1 << 20).to_s
在unicorn.rb中設置了 timeout, 壓測返回500 就是 這個造成的,將timeout設置600.





總結

以上是生活随笔為你收集整理的git压测出现访问500的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內容還不錯,歡迎將生活随笔推薦給好友。