简体   繁体   English

Rails工作人员优化

[英]Rails worker optimization

I have couple of worker running background job. 我有几个正在运行后台工作的工人。 The method in this workers are like ~100 lines. 这个工人的方法大约是100行。 What are general practices in optimizing and moving code to different files in Rails for Workers. 在Rails for Workers中优化代码并将代码移动到不同文件中的一般做法是什么。

您只需要参加一些新的课程,并要求在您的工作人员之上。

I like to use resque, but the problem here is what we load all environment with each worker, so worker natively are very slow. 我喜欢使用resque,但是这里的问题是我们向每个工作程序加载所有环境,所以工作程序本来就很慢。 I think the good idea about this is to load only class what you really need. 我认为关于此的好主意是只加载您真正需要的类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM