我试图debugging为什么我的服务器有3秒延迟每个请求。 这些是我的nginx和独angular兽configuration文件: https : //gist.github.com/regedarek/de7f2e5cd1918b6224ac 我的服务器信息: Welcome to Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-37-generic x86_64) System load: 0.02 Processes: 71 Usage of /: 38.9% of 6.89GB Users logged in: 0 Memory usage: 28% IP address for eth0: 149.156.119.151 Swap usage: 0% server:~$ cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 6 model : […]
我最近在Rails 3.2.12应用程序前面设置了一个NodeBalancer。 该应用程序由nginx和独angular兽服务。 所有似乎都很好,但我得到了很多错误,如我只有一台服务器时没有得到的错误。 IP spoofing attack?!HTTP_CLIENT_IP="10.16.81.184"HTTP_X_FORWARDED_FOR="136.160.88.153, 192.168.255.5" actionpack (3.2.12) lib/action_dispatch/middleware/remote_ip.rb:55:in `calculate_ip' 这是我的应用程序的nginxconfiguration。 upstream unicorn { server unix:/tmp/unicorn.ahotu-calendars.sock fail_timeout=0; } server { listen 80 default deferred; root /home/deployer/apps/appdirectory/current/public; if (-f $document_root/system/maintenance.html) { return 503; } error_page 503 @maintenance; location @maintenance { rewrite ^(.*)$ /system/maintenance.html last; break; } location ^~ /assets/ { gzip_static on; expires max; […]
我有两个应用程序,每个运行在独angular兽上。 我想使用nginx作为每个应用程序的前端。 对于每个nginx /独angular兽对,我会使用专用的unix套接字。 为此,我是否需要nginx的实例,或者我可以使用2个虚拟主机吗?
我正在使用nginx作为服务器后端 sqlbuddy.example.com – 用于数据库pipe理(php-fpm) example.com – 主站点(独angular兽) 当我去www.example.com时,我得到sqlbuddy.example.com 如何在www.example.com上获得example.com sqlbuddy server { listen sqlbuddy.example.com:80; client_max_body_size 1G; server_name sqlbuddy.example.com; keepalive_timeout 5; root /home/example/sqlbuddy; index index.php; location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $fastcgi_script_name; include fastcgi_params; } } example.com upstream example_server { server unix:/home/example/application/shared/unicorn.sock fail_timeout=0; } server { listen example.com:80; client_max_body_size 1G; server_name example.com; […]
在研究Unicornconfiguration选项时,我遇到了这个片段。 GC.respond_to?(:copy_on_write_friendly=) and GC.copy_on_write_friendly = true 如果我正确地做了,它会优化Unicorn如何处理内存分配和工人之间的资源共享? 我使用独angular兽来为我的Sinatra应用程序在Ruby 1.9.3服务器上运行。 在我的独angular兽configuration中包含copy_on_write_friendly设置有什么缺点吗?
我有几个在Ubuntu 12.04上运行的Unicorn服务器,我正在寻求保护它们免受远程shell的攻击。 我主要关心的是,如果部署ModSecurity是有意义的? 另一件事是,我已经看到Unicorn通常从端口8080运行,并将其转发到作为反向代理的Apache / NginX服务器端口80。 我在想,我可以雇用以下人员: Apache上的ModSecurity 作为工作者的Apache(带有mod_qos的线程),以防止来自任何主机的过多的请求 从指定的用户运行独angular兽服务器,并通过AppArmor或SELinux隔离它,如果它是Redhat / Centos的 我想知道,如果有另一个强化框架/修补程序的RoR像PHP Suhosin。
任何人都可以说明这个错误究竟是指什么? 我在部署新版本的网站时遇到问题。 I, INFO — : reloading config_file=[snip]/current/config/unicorn.rb I, INFO — : Refreshing Gem list E, ERROR — : error reloading config_file=[snip]/current/config/unicorn.rb: Application has been already initialized. (RuntimeError) E, ERROR — : [snip]/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/application.rb:135:in `initialize!' E, ERROR — : [snip]/shared/bundle/ruby/1.9.1/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing' E, ERROR — : [snip]/releases/20120907085937/config/environment.rb:5:in `<top (required)>' E, ERROR — : [snip]/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require' E, ERROR […]
我似乎没有理由得到麒麟工人的间歇性超时,我想要一些帮助来debugging实际的问题。 这更糟,因为它可以处理大约10到20个请求,然后1将超时,然后再有10 – 20个请求,同样的事情会再次发生。 我已经创build了一个开发环境来说明这个问题,所以除了我之外没有任何交通。 这个堆栈是Ubuntu 14.04,Rails 3.2.21,PostgreSQL 9.3.4,Unicorn 4.8.3,Nginx 1.6.2。 问题 我会详细描述它不工作的时间。 我通过浏览器请求一个url。 Started GET "/offers.xml?q%5bupdated_at_greater_than_or_equal_to%5d=2014-12-28T18:01:16Z&q%5bupdated_at_less_than_or_equal_to%5d=2014-12-28T19:30:21Z" for 127.0.0.1 at 2014-12-30 15:58:59 +0000 Completed 200 OK in 10.3ms (Views: 0.0ms | ActiveRecord: 2.1ms) 正如你所看到的,这个请求在10.3ms内成功地完成了200个响应状态。 然而,浏览器挂了大约30秒,独angular兽杀死了工人: E, [2014-12-30T15:59:30.267605 #13678] ERROR — : worker=0 PID:14594 timeout (31s > 30s), killing E, [2014-12-30T15:59:30.279000 #13678] ERROR — : reaped […]
我正在从nginx +乘客迁移到nginx +独angular兽,我已经达到了一点,我有点卡住了。 当我试图查看我的testing服务器时,除了404页面,我什么都没有。 我确定我的虚拟主机configuration有一些东西,但是我只是没有看到问题所在。 任何帮助,这是非常感谢。 这是我的vhost文件的当前版本 upstream unicorn-staging { server unix:/data/appname/staging/current/tmp/sockets/unicorn-staging.sock fail_timeout=0; } server { listen 80 deferred; listen 443; ssl on; root /data/appname/staging/current/public; server_name foo; access_log /data/appname/staging/current/log/unicorn-staging-access.log; error_log /data/appname/staging/current/log/unicorn-staging-error.log; client_max_body_size 4G; ssl_certificate /data/appname/staging/shared/certs/appname.crt; ssl_certificate_key /data/appname/staging/shared/certs/appname.key; location / { proxy_pass http://unicorn-staging; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto […]
我有一个在Ubuntu上运行的堆栈,由一个在Sinatra和GrapeAPI中编写的Rack应用程序组成。 应用程序堆栈包括Redis,Postgres,Nginx和独angular兽。 我想用上帝来处理过程监控。 目前部署是通过git在部署用户下进行的。 这个部署用户不是一个sudoer。 我的问题:谁应该拥有神的过程? 作为sudoer或部署用户运行该进程是最好的吗? 以部署用户身份运行将加载允许独angular兽启动的rbenv,但部署用户不具有sudo访问权限,因此将无法运行init.d脚本。 另一方面,当我作为一个不同的用户运行时,部署用户god不能访问由rbenv提供的bundle exec,因为如果他们closures,不能启动独angular兽进程。