Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
任凯
@ailen
高级会员
第 2990 位会员 / 2012-07-24

[email protected]
西南石油大学
成都
27 篇帖子 / 247 条回帖
6 关注者
3 正在关注
71 收藏
no excusion always solution
GitHub Public Repos
  • unified_iap 1

    iap order veify service for googleplay and amazon and ios

  • rails-k8s-docker-demo 0

    rails k8s demo

  • rails_application_nginx 0

    docker rails nginx

  • globalize 0

    Rails I18n de-facto standard library for ActiveRecord model/data translation.

  • docker-rails 0

    Dockerize Rails 6 with ActionCable, Webpacker, Stimulus, Elasticsearch, Sidekiq

  • timer 0

  • taobao-top 0

    A simple ruby implementation of Taobao TOP API

  • sim_trad 0

  • WebHubBot 0

    Python + Scrapy + MongoDB . 5 million data per day !!!💥 The world's largest website. 🔞

  • better-emacs 0

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • Nginx 用作负载均衡配置问题 at 2015年04月28日

    #7 楼 @huacnlee 好的,非常感谢,我马上看看

  • Nginx 用作负载均衡配置问题 at 2015年04月28日

    @huacnlee 192.241.225.37、192.241.207.103 是两个独立的 app server,环境是 rails + passenger,107.170.216.243 只装有 nginx,用来做 nginx 的 load balancer。我是直接访问 107.170.216.243 只出现了 nginx 的欢迎页面。

  • Nginx 用作负载均衡配置问题 at 2015年04月28日

    @huacnlee

    server {
      listen 80;
      server_name 107.170.216.243;
      location / {
        proxy_pass  http://backend;
        access_log /var/log/nginx/proxy.log;
        #include /etc/nginx/proxy_params;
        proxy_http_version 1.1;
        proxy_set_header Connection "";
      }
    }
    
    upstream backend  {
      server 192.241.225.37;
      server 192.241.207.103;
    }
    

    这个是现在完整的配置

  • Nginx 用作负载均衡配置问题 at 2015年04月28日

    @huacnlee 具体的表现是 appserver 已经收到了 load balancer 发过来的请求,但是 load balancer 还是只出现 ngxin 的欢迎页面,具体的日志如下:比如我从浏览器访问 load balancer, load balancer 的访问日志如下:

    125.71.203.92 - - [27/Apr/2015:22:12:32 -0400] "GET / HTTP/1.1" 200 396 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36"
    

    app server 的访问日志如下:

    107.170.216.243 - - [27/Apr/2015:22:12:32 -0400] "GET / HTTP/1.1" 200 396 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36"
    

    收到了请求,但是浏览器始终返回 nginx 的欢迎界面. 请帮我看看

  • eval 方式添加对象属性排错 at 2015年04月21日

    @linuxgit

    irb(main):042:0> p "Daniel".object_id  == "Daniel".object_id
    false
    

    如果换成

    s = "Daniel"
    s.my_attr = "ruby"
    p s.my_attr
    

    就是对的

    附上链接:http://ruby-doc.org/core-2.2.2/Object.html#method-i-object_id

  • 告诉大家一个不幸的消息 at 2015年04月01日

    @lips 跟老师关系搞好就行了,哈哈

  • 告诉大家一个不幸的消息 at 2015年04月01日

    @lips 老板知道的,不管的,他忙得很,不过话说回来在学校纯粹是浪费时间

  • 告诉大家一个不幸的消息 at 2015年03月30日

    @lips 研二

  • 告诉大家一个不幸的消息 at 2015年03月29日

    @lips 差不多,老师也是水的,跟老师说明情况就好,不过这个看每个老师的性格,good luck to u!!

  • [译] Five Ruby Methods You Should Be Using at 2015年03月13日

    @karloku OK, thank U

  • 关于 bundle 的一个弱弱的问题 at 2015年02月10日

    @knight 如何直接brew install postgresql的话 libpg 应该是安装了的,你可以把 pg 卸载了重装一下。

  • Awesome Ruby at 2015年02月07日

    @dotcomxy cool! :thumbsup:

  • 做个调查,大家对窗口管理工具有需求吗? at 2015年02月06日

    我的 Mac 用的是Divvy

  • C# 的代码, 有没有大神帮忙翻译成 Ruby 感谢 at 2015年02月04日

    @yjiiyygy 能格式化下么?https://help.github.com/articles/markdown-basics/ 这个是 markdown 的帮助文档

  • 出一个小米 PAD, 64G,年会奖品 at 2015年02月02日

    @david_w 对小米无爱,买个手机半年修了 3 次

  • Rails 如何快速生成大量的数据表 at 2015年02月02日

    @tobone 哈哈,抽时间写个 gem 给你用看看咯

  • Cannot allocate memory 错误 at 2015年02月02日

    @luffycn 前两天写的这个帖子,可以参考下:https://ruby-china.org/topics/24034
    另外你可以 top 一下,看看那些占用内存比较大的。

  • Rails 如何快速生成大量的数据表 at 2015年02月02日

    @tobone Sorry,没看清题意。不过同理,如果创建多个数据表可以用:

    sql = "create table xxx()"
     ActiveRecord::Base.connection.execute(sql)
    

    上面只是举个例子,但是 rails 中创建表都是建议用 migration。你要知道 rails 的 ORM 的设计原则,如果只有表没有 Model,这个就太 php 了啊。

  • Rails 如何快速生成大量的数据表 at 2015年02月02日

    @tobone 这个方式可以有很多种呀,举一个例子:比如你的 model 叫 SomeModel,如果你想生成 n 条记录可以在 seed 里面写上一个

    n.times { SomeModel.create(xxx) }
    

    xxx 可以根据你的需求构建。

    方案 1 和 3 我觉得不靠谱。

  • 关于 Rails 的冒号 at 2015年01月31日

    @lmm19891114 请看文档 http://www.ruby-doc.org/core-2.2.0/Symbol.html http://ruby-doc.org/core-2.1.5/Hash.html http://www.reactive.io/tips/2009/01/11/the-difference-between-ruby-symbols-and-strings/

  • [译] Five Ruby Methods You Should Be Using at 2015年01月29日

    @villins

    irb(main):002:0> ['0'] * 8
    => ["0", "0", "0", "0", "0", "0", "0", "0"]
    

    这样岂不是更好么? 翻译时候想到了更简单的方法,但是毕竟是翻译,所以还是保留了原来的.😄

  • Ruby on Rails 当中的路由具体有什么作用 at 2015年01月26日

    建议楼主看文档,http://guides.rubyonrails.org/routing.html 解释:

    The Rails router recognizes URLs and dispatches them to a controller's action. It can also generate paths and URLs, avoiding the need to hardcode strings in your views.
    
  • 个人做的 Ruby 的 cocos2d-x 绑定 at 2015年01月24日

    @kinotrip cool,了解过 JSB,你这个 ruby binding 值得研究啊

  • PostgreSQL 接近 6 亿条记录,加了索引,查询效率优化问题? at 2015年01月23日

    @cderong 被坑过,是从 mysql 坑过,就是从 mysql 切换到 pg 的

  • PostgreSQL 接近 6 亿条记录,加了索引,查询效率优化问题? at 2015年01月23日

    @vincent 我看了分表的话好像是从空表开始的,如果是将这已经存在的 6 亿条数据分表,有什么好的建议呢?

  • PostgreSQL 接近 6 亿条记录,加了索引,查询效率优化问题? at 2015年01月23日

    @gazeldx 哈哈,没办法,运营要看数据

  • PostgreSQL 接近 6 亿条记录,加了索引,查询效率优化问题? at 2015年01月23日

    @hooopo @ch3n 谢谢,目前在考虑拆表方面的设计

  • PostgreSQL 接近 6 亿条记录,加了索引,查询效率优化问题? at 2015年01月22日

    @Peter 我用的 DO 的$320/m 的服务,就是 SSD

  • PostgreSQL 接近 6 亿条记录,加了索引,查询效率优化问题? at 2015年01月22日

    @hooopo @vincent 谢谢,我试试看

  • PostgreSQL 接近 6 亿条记录,加了索引,查询效率优化问题? at 2015年01月22日

    @small_fish__ 单个查询需要两秒,因为要分析大概 2 个星期的数据,DB time 跟 CPU time 加起来大概 10 多秒,难以忍受啊,多以才要优化的 😄

  • 上一页
  • 1
  • 2
  • 3
  • 4
  • 5
  • …
  • 7
  • 8
  • 下一页
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English