query: tag:issue

One of my websites had begun to use Amazon ELB for load balancing.
After that, I have experienced the issue that I can't do +1 at the site.

ss

As long as I see the webmaster tools, the +1 audience has stopped its increase since that time.
In addition, the site has issues too on several Google's services such as Google Wireless Transcoder, Google Translation and so on.
They report that it can't access to the site.

In my observation, some of Google servers have incorrect DNS caching, so thus the services couldn't access to the site, because the IP address is no longer pointing the original server.

The DNS of Amazon ELB has TLS of 60 seconds. Google's DNS caching should expire within that period.

** See Also **

** Update **

It's turned out that Google+ itself too causes this problem.

ss2

posted by takiuchi takiuchi on Mon 5 Sep 2011 at 05:20 with 0 comments

Merb/DataMapperをしばらく使っていたのですが、
少なくともバージョン0.9.10, 0.9.11では、
associationの実装にバグがあり、
レコード数が多いテーブルがあると、aggregation系の処理に時間がかかるという問題がある事が分かりました。

例えば、Post.has n, :comments な関係がある時に、
以下のようなコードを実行すると、このようになります。

ruby>>
?> Post.first.comments.count #=> 188
~ (0.000865) SELECT "id" FROM "posts" ORDER BY "id" LIMIT 1
~ (0.000094) SELECT "id", "post_id" FROM "comments" WHERE ("post_id" IN (1)) ORDER BY "id"
~ (0.000063) SELECT COUNT(*) FROM "comments" WHERE ("post_id" = 1)
<<--

2つ目のSQLは不要なのですが、発行されてしまいます。
例えばCommentのレコード数が多かった場合、Commentオブジェクトを大量に生成しようとしてしまうため、致命的な遅さになってしまいます。

目下この問題の解決策を探しているところですが、
Edge-DMのspec/仕様でerrorが出ている状態なので、なかなか手が付けられない感じです。
とりあえず、dm-coreのassociations/relationship.rbの中の、

ruby>>
# @api private
def get_children(parent, options = {}, finder = :all, *args)
parent_value = parent_key.get(parent)
bind_values = [ parent_value ]

    with_repository(child_model) do |r|
      parent_identity_map = parent.repository.identity_map(parent_model)

      query_values = parent_identity_map.keys
      bind_values = query_values unless query_values.empty?
      query = child_key.zip(bind_values.transpose).to_hash
      collection = child_model.send(finder, *(args.dup << @query.merge(optio

ns).merge(query)))

      return collection unless collection.kind_of?(Collection) && collection.any?

<<--

の最後の collection.any? で件のSQLが実行されているところまでは分かりました。
DataMapper::CollectionはextlibのLazyArrayを継承しているクラスなのですが、どうもそのへんの仕様が変わったのに追従できてないのかな。
モジュールを過度に分散しすぎるのも、整合性を保つのが大変になるという問題がありますね。
注意深く完全なSpecを書く事を心がけていれば防げる問題かもしれないですが。

posted by genki genki on Wed 8 Apr 2009 at 04:52 with 0 comments

I am using merb with passenger on our production server.
The passenger is going well in most of cases.
But if dependent gems have been updated, it becomes acting up when it got restarted.
After I encountered such situations several times, I decided to begin investigation about the issue.

Detail of the issue is as follows.

  • My merb app becomes causing errors after restarting of passenger by "touch tmp/restart.txt" if dependency gems were updated and they have no compatibility.
  • Even if the gems were compatible, my merb app kept using old gems until apache is reloaded.
  • pids were changing successfully while restarting.
  • /etc/init.d/apache reload can refresh everything as expected.
  • "touch tmp/restart.txt" can't.

I wonder there is the master of master processes which keeps LOAD_PATH and it is refusing to use new gems.
I am thinking I should investigate the Rack.

Update

Finally, the issue was solved!

The solution is found here

posted by takiuchi takiuchi on Sat 17 Jan 2009 at 22:41 with 0 comments