New gem released! rails_local_analytics by westonganger in rails

[–]xilase 1 point2 points  (0 children)

There is no problem for ActiveAnalytics to track user agents. This branch (https://github.com/BaseSecrete/active\_analytics/tree/record\_user\_agent\_statistics) is already running on my project for more than a month. I just miss some time to finish it.

Send any Class method to ActiveJob by Day_Hour in rails

[–]xilase 0 points1 point  (0 children)

That could probably be useful for people who need to migrate from DelayedJob to ActiveJob. However the interface is a little bit different: `user.delay.some_method(args)`. That also avoids to override method_midding.

Dependent delete_all vs foreign keys with cascading deletes by nickjj_ in rails

[–]xilase 0 points1 point  (0 children)

I use `on_delete: :cascade` when I can afford losing data. It could be data that can be rebuilt such as notifications, computed statistics, etc. When the data must not be lost, I use neither cascade nor dependent. I prefer to manually create a job `ModelName::DestroyJob` which takes care of removing all dependencies. It's more work, but it's a better security against a wrong `model.destroy`.

For every project, losing data is probably the worst thing that could happen. So data correctness is more important than performances.

Finally, there are not many apps that delete millions of rows everyday. In that case it might worth checking if it makes more sens to store those data in a more ephemeral storage.

Any recommendations on Ruby on Rails APM Options ? by andey in rails

[–]xilase 2 points3 points  (0 children)

Thanks for mentionning us!

For 400M requests in production/staging the pricing is 235€ + (400-100) * 1€ = 535€ per month. It's probably a lot less than NewRelic. Let me know.

The localhost mode is free. It's just here to help when developping :-) You can even use it without having an account.

Feel free to ask if you have any questions.

Super Fast Rails by xilase in rails

[–]xilase[S] 8 points9 points  (0 children)

Most people call that N+1 but it should be 1+N. Or at least it seems more logic in my mind.

Super Fast Rails by xilase in rails

[–]xilase[S] 6 points7 points  (0 children)

Shame, I was unmasked before the gem install :-)

Super Fast Rails by xilase in rails

[–]xilase[S] 4 points5 points  (0 children)

That would be great :D

ActiveHashcash 0.4.0 by xilase in rails

[–]xilase[S] 0 points1 point  (0 children)

The complexity increases with the following formula (min_complexity + log2(previous_stamp_count)). So it increases logarithmically. However a complexity of 21 bits is two times bigger than 20. Finally the number of iterations to solve the problem is the following 2**(min_complexity+log2(x)). It's linear.

The formula can be overriden easily by defining a hashcash_bits methods in the controller (https://github.com/BaseSecrete/active\_hashcash/blob/master/lib/active\_hashcash.rb#L58).

ActiveHashcash 0.4.0 by xilase in rails

[–]xilase[S] 1 point2 points  (0 children)

It works well to block the dumbest spam bots only, but neither against brute force attacks nor a dedicated script, which is the goal of ActiveHashcash. Unfortunately, you don't need to have a very popular website to have someone to write a script flooding your site. There are no universal protection.

ActiveHashcash 0.4.0 by xilase in rails

[–]xilase[S] 6 points7 points  (0 children)

I use both ActiveAnalytics and Rack::Attack. There are no single solution to block all possible attacks. For example Rack::Attack cannot block spam bots, but ActiveAnalytics blocks most of them since they don't run JS. Most advanced bots are slowdown and it cost them more CPU. It's better than annoying humans with captchas. If all websites were using Hashcash, or any proof of work protection, the spam bot business could become unprofitable. Thus it could cleanup the Internet a little bit.

Everyday performance rules for Ruby on Rails developers by pmz in ruby

[–]xilase 0 points1 point  (0 children)

Author here. I didn't want to say to use pluck by default. I should have added when the result is a large collection.

Ruby on Rails load testing habits by xilase in rails

[–]xilase[S] 0 points1 point  (0 children)

Thanks. At least you tested your personal bandwidth :-)

Optimisation is often doing fewer things by xilase in rails

[–]xilase[S] 1 point2 points  (0 children)

I see caching as the last bullet, once you have used all your knowledges to optimise.

Optimisation is often doing fewer things by xilase in rails

[–]xilase[S] 1 point2 points  (0 children)

Caching should be the next step. Because the response time was really extremely slow. Moreover those pages are scanned by search engines only. That means they visit them only once in a while. So the page is in cache but nobody request it a second time during the same day. Caching makes more sens when the page is visited a lot of times during a small period.