gpt4 book ai didi

ruby-on-rails - 乘客不断抛出连接错误

转载 作者:行者123 更新时间:2023-12-04 19:03:28 24 4
gpt4 key购买 nike

当我的网站获得高流量时,我通过 Google Analytics 定期看到下降,并且在 nginx 错误日志中出现这种错误:

App 17888 stderr: [ 2014-02-22 17:02:23.5307 19258/0x0000000609a820(Worker 1) utils.rb:68 ]: *** Exception Errno::ECONNRESET in Rack body object #each method (Connection reset by peer) (process 19258, thread 0x0000000609a820(Worker 1)):
App 17888 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/utils/unseekable_socket.rb:114:in `write'
App 17888 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/utils/unseekable_socket.rb:114:in `write'
App 17888 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:141:in `block in process_request'
App 17888 stderr: from /home/ubuntu/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.12/lib/active_record/query_cache.rb:46:in `each'
App 17888 stderr: from /home/ubuntu/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.12/lib/active_record/query_cache.rb:46:in `each'
App 17888 stderr: from /home/ubuntu/.rvm/gems/ruby-1.9.3-p484/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:460:in `each'
App 17888 stderr: from /home/ubuntu/.rvm/gems/ruby-1.9.3-p484/gems/rack-1.4.5/lib/rack/body_proxy.rb:31:in `each'
App 17888 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:140:in `process_request'
App 17888 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:142:in `accept_and_process_next_request'
App 17888 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:110:in `main_loop'
App 17888 stderr: from /usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'

我认为这与打开的套接字数量或其他有关,我不知道。所以问题是这是什么,我该如何解决。

这是有关我的服务器和应用程序的一些信息:

Nginx:
  • worker_processes:32
  • worker_connections:4096
  • passgener_max_queue_size: 0
  • 乘客最大池大小:75
  • 乘客最小实例:75

  • rails :
  • activerecord 池大小:16(这太小了吗?)

  • 服务器:
  • 32 个 CPU
  • 60GB 内存

  • 我还将允许打开的套接字数量增加到 500K,允许打开的文件数量增加到 300K。

    最佳答案

    ECONNRESET 是一个正常的套接字错误,仅表示客户端在请求/响应周期完成之前关闭了连接。您可以放心地忽略它。

    关于ruby-on-rails - 乘客不断抛出连接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21957564/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com