Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
@quakewang
VIP
NO. 162 / 2011-11-22

[email protected]
上海
26 Topics / 752 Replies
212 Followers
4 Following
22 Favorites
GitHub Public Repos
  • rfcs 1

    This repository contains proposals, standards and documentations related to Nervos Network.

  • linux 1

    Linux kernel source tree

  • cfn-node 0

  • ckb 0

    CKB is a public/permissionless blockchain, the layer 1 of Nervos network.

  • ractor 0

    Rust actor framework

  • autocorrect 0

    A linter and formatter for help you improve copywriting, to correct spaces, punctuations between ...

  • ckb-vm 0

    CKB's vm, based on open source RISC-V ISA

  • ckb-auth 0

    A consolidated library featuring numerous blockchains authentication techniques on CKB-VM

  • hyprnote 0

    Privacy-first AI Notepad for back-to-back meetings

  • fiber-scripts 0

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 大家都买房了么 at June 27, 2013

    有 N 套房的飘过...都来鄙视我吧,可以结帖不?

  • 蝉游记网站的部署 Nginx,Unicorn,Capistrano,OOB,Graceful Restart at June 27, 2013

    #14 楼 @huacnlee 是在 Nginx 之前加 Haproxy 吧?在之间加没意义啊,我们以前是这样用的,那个项目是 Nginx+Passenger,不过 Unicorn 也一样: http://quake.iteye.com/blog/1313623

  • 蝉游记网站的部署 Nginx,Unicorn,Capistrano,OOB,Graceful Restart at June 27, 2013

    #6 楼 @zj0713001 正如#8 楼 @outman 所说,ruby2.0 开启 COW,内存使用还是可接受的,unicorn.rb 里面有这样一段:

    # To save some memory and improve performance
    preload_app true
    GC.respond_to?(:copy_on_write_friendly=) and
      GC.copy_on_write_friendly = true
    

    另外我在主贴,补充了 2 个图,共 3 台服务器 (每台都是 2core, 4G,监控上显示 4 台,其中一台是内部测试的),每台开 6 个 unicorn worker,平均一个 200MB 左右,如果内存紧张的话,减少 worker 和 WorkerKiller::Oom 的内存上限,1G 左右的内存 +20% 的 CPU,很轻松一台就可以支持 200 RPM。

  • 蝉游记网站的部署 Nginx,Unicorn,Capistrano,OOB,Graceful Restart at June 27, 2013

    #9 楼 @ashchan unicorn 本身启动命令就是 capistrano 里面的 start 命令: "cd #{current_path} && RAILS_ENV=production bundle exec unicorn_rails -c #{unicorn_config} -D"

    将他放到服务器的启动脚本里面就可以实现自动重启了。

  • 为什么投资人喜欢 Rails at June 27, 2013

    你想多了,接触过的投资人从来没问过我们网站是用什么写的,人家真不关心这个...

  • 用于数据缓存, 什么 nosql 适合 at June 26, 2013

    #19 楼 @luikore 配置 Redis 用 LRU 就不用关心 expire 拉。

  • 珍爱生命,远离 devise at June 26, 2013

    #11 楼 @jasl 不会返回 email 的 api,可以给用户随机生成一个

  • 珍爱生命,远离 devise at June 26, 2013

    另外,你说的这个问题,devise 的 wiki 上已经提到过,可以翻一下 wiki 上关于 omniauth 集成的,password 是用随机 token,email 是从 api 获取。

    另另外,通常我喜欢用 create!,提早抛出异常,而不是用 create 的返回值来判断

  • 珍爱生命,远离 devise at June 26, 2013

    devise 不算复杂,花点时间看一下源码,特别是 models 下面的几个 able.rb,就能理解一下它为什么这么设计。对于掌握一个系统的用户登录,管理等基础设施来说,这点投资是绝对划算的。

  • 我的世界将是一个 RPG 的世界 at June 24, 2013

    在 FPS 玩家世界里面 RPG 明显是 rocket propelled grenade

  • [官方声称是 bug 将会修正] MySQL 正式转为闭源软件,感谢 Oracle ,感谢 CCTV at June 19, 2013

    一直在用 mariadb,无压力飘过

  • 能谈谈你们现在的服务器环境和部署方式吗? at June 18, 2013

    #9 楼 @robbin 看了 uncorn 的各种好处,再加上 passenger 非企业版本不支持平滑重启,所以换了 :)

    #12 楼 @_samqiu 用 https://github.com/agentzh/headers-more-nginx-module 改的,好处你懂的 :)

  • 能谈谈你们现在的服务器环境和部署方式吗? at June 18, 2013

    服务器 nginx+unicorn 部署用 capistrano

  • 自己的孩子,大家多提意见! at June 18, 2013

    好吧,还有 xss,sql 注入,我真是蛋疼浪费时间在这个网站上,这个是广告吧?

  • 自己的孩子,大家多提意见! at June 18, 2013

    用 pagespeed 测一下,得分只有 30 多,连 js 和 css 都不响应压缩版本,其他还要提么?

  • 一个关于 rails 关联模型的创建问题 at June 14, 2013

    改成校验 article 试试看:

    belongs_to :article
    validates_presence_of :name, :article
    

    实在不行的话,只能自己写 validate 方法了

  • 正在策划一个高级黑等级,请大家看看合不合理。 at June 10, 2013

    我有个朋友,鼻孔很大。在北京坚持晨跑,一个月胖了二十斤。

  • 字符串压缩,有木有更优雅方式? at June 09, 2013

    正则替换的解法:

    "aaabbac".gsub(/(([a-z])\2*)/) {|s| $1.length > 1 ? $2 + $1.length.to_s : $2}
    
  • MySQL 有没有较的数据备份方案. at June 07, 2013

    如果有机器资源的话,master/slave 是最好的 如果服务器是用 LVM,可以用 snapshot 都没有的话,推荐用 xtrabackup

  • 有关 ruby 进程的内存性能优化 at June 06, 2013

    1G 内存实在太小了,稍微复杂一点的 rails 应用,一个进程很容易就跑到 200M,还是升级一下内存吧,4G 是标配了。

  • 请教 session 值无预警被覆盖为另一个值的问题 at June 06, 2013

    没遇到过这样的问题,试试看换 memcache 的 client gem 到 dalli 看看,我记得 dalli 解决了 fork 导致的 socket share。

  • 唉 最近有点盐 at June 04, 2013

    我承认有点蛋疼

  • High performance Rails at June 03, 2013

    json.cache! 这是 rails 4 json builder 自带的?没用过呢,之前用 cache 都是在 controller 里面用 caches page 或者 view 里面用 fragment cache,这个性能对比测试看上去是 cache 没生效的样子。

  • High performance Rails at June 03, 2013

    #15 楼 @aptx4869 cache 用的是 disk cache?生成的 json 内容是不是很小?换 memcached 或者 redis 试试看

  • High performance Rails at June 03, 2013

    #10 楼 @huacnlee 如果没有内存监控自杀的话,我发现在 gc disable 的情况,用 oob 内存会莫名暴涨,很奇怪。

  • High performance Rails at June 03, 2013

    #8 楼 @huacnlee 搭配文中提到的 unicorn-worker-killer,根据服务器的内存和 unicorn worker 配置数量调整一下单个上下限,我们的应用实测下来平均从 140ms 下降到了 120ms,效果还是很明显的

  • 六一在家折腾个 WALL·E 给闺女玩 (已更新:Audio & Text to Speech) at June 03, 2013

    碉堡,我现在已经改入 Lego 的坑了,发现比 Arduino 贵多了,泪奔

  • High performance Rails at June 03, 2013

    #6 楼 @huacnlee 这样在用户请求的时候不会发生 GC,然后在请求完成后进行 GC,避免 GC 对用户请求时间的影响。

  • High performance Rails at June 02, 2013

    竟然和我们用的组件惊人的一致,unicorn,oob,memory killer,slim•••

  • Prev
  • 1
  • 2
  • …
  • 13
  • 14
  • 15
  • 16
  • 17
  • …
  • 24
  • 25
  • Next
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English