{"id":18006,"date":"2011-11-03T18:25:06","date_gmt":"2011-11-04T00:25:06","guid":{"rendered":"http:\/\/rankexploits.com\/musings\/?p=18006"},"modified":"2011-11-03T18:34:32","modified_gmt":"2011-11-04T00:34:32","slug":"sorry-bergen-norway","status":"publish","type":"post","link":"https:\/\/rankexploits.com\/musings\/2011\/sorry-bergen-norway\/","title":{"rendered":"Sorry Bergen Norway!"},"content":{"rendered":"<p>Yesterday, Bebben from Norway left this note at Jeff&#8217;s blog:<\/p>\n<blockquote><p>Sorry for the OT, but for reasons unknown, it turns out that myself and various other Norwegians independently of each other suddenly don&#8217;t get access to Lucia&#8217;s Blackboard. We get the message<\/p>\n<p>&#8220;Forbidden<br \/>\nYou don&#8217;t have permission to access \/musings\/ on this server.<\/p>\n<p>Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.&#8221;<\/p>\n<p>So what&#8217;s up, did you block us Lucia&#8230; please don&#8217;t, we miss you&#8230;<\/p>\n<p>Bebben (and others), Bergen &#8211; Norway<\/p><\/blockquote>\n<p>A few other innocent people have been blocked. I thought I would explain why. Of course, it has to do with &#8216;bots.  As I&#8217;ve mentioned before &#8216;bots rove around hitting my server.  To people who don&#8217;t self host, the main problem with &#8216;bots is a &#8216;bot might:<\/p>\n<ol>\n<li>Read <i>your<\/i> email on a web page and send <i>you<\/i> spam.<\/li>\n<li>Break into my blog, insert malicious links and inject malware into your pc or<\/li>\n<li>Leave spammy comments for &#8220;male enhancement products&#8221;<\/li>\n<\/ol>\n<p>But since I pay for hosting, I have another difficulty.  While attempting to do the above, some stupidly programmed bots loads tons of pages at once and cause my server load to exceed the level of resources I pay for. As it happens, I pay enough to get Dreamhost to guarantee me 400 MB of memory.  If the memory draw rises above that, my blog can go down. Some comments can get lost.  Entire posts can get lost. Visitors get grumpy because pages don&#8217;t load, and so on.<\/p>\n<p>Notice in the graph below, the memory draw (red line) suddenly shot up around quarter to 7 (server time) today:<\/p>\n<p><a href=\"http:\/\/rankexploits.com\/musings\/wp-content\/uploads\/2011\/11\/ResourcesUsed.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/rankexploits.com\/musings\/wp-content\/uploads\/2011\/11\/ResourcesUsed-500x265.jpg\" alt=\"\" title=\"ResourcesUsed\" width=\"500\" height=\"265\" class=\"aligncenter size-medium wp-image-18007\" srcset=\"https:\/\/rankexploits.com\/musings\/wp-content\/uploads\/2011\/11\/ResourcesUsed-500x265.jpg 500w, https:\/\/rankexploits.com\/musings\/wp-content\/uploads\/2011\/11\/ResourcesUsed-300x159.jpg 300w, https:\/\/rankexploits.com\/musings\/wp-content\/uploads\/2011\/11\/ResourcesUsed.jpg 722w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<p>Some of you might wonder: What could have happened at quarter to seven? Turn&#8217;s out, that&#8217;s when a stupidly programmed &#8216;bot hit the blog:<br \/>\n<a href=\"http:\/\/rankexploits.com\/musings\/wp-content\/uploads\/2011\/11\/ResourceConsumingBot1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/rankexploits.com\/musings\/wp-content\/uploads\/2011\/11\/ResourceConsumingBot1-500x154.jpg\" alt=\"\" title=\"ResourceConsumingBot\" width=\"500\" height=\"154\" class=\"aligncenter size-medium wp-image-18014\" srcset=\"https:\/\/rankexploits.com\/musings\/wp-content\/uploads\/2011\/11\/ResourceConsumingBot1-500x154.jpg 500w, https:\/\/rankexploits.com\/musings\/wp-content\/uploads\/2011\/11\/ResourceConsumingBot1-300x92.jpg 300w, https:\/\/rankexploits.com\/musings\/wp-content\/uploads\/2011\/11\/ResourceConsumingBot1-1024x316.jpg 1024w, https:\/\/rankexploits.com\/musings\/wp-content\/uploads\/2011\/11\/ResourceConsumingBot1.jpg 1500w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><br \/>\nThat image represents a subset of the hits by this &#8216;bot.<\/p>\n<p>I don&#8217;t know what this bot meant to do. But I do know it was loading so many pages it caused Dreamhost to send me this email:<\/p>\n<blockquote><p>Hi lucia!<\/p>\n<p>Nobody likes to hear that they&#8217;ve packed on a few pounds, but we wanted you to hear it from a friend.<\/p>\n<p>Your DreamHost VPS, ps33830, has just exceeded the memory allocation that you&#8217;ve established.  If left unchecked that behavior could begin to negatively impact the VPS services of every other customer on your server.<\/p>\n<p><em>As a result we&#8217;ve had to reboot your VPS, effectively restarting your virtual machine.  You may experience several minutes of downtime while your services come back online.<\/p>\n<p>Based on the usage pattern that we&#8217;ve seen today, it&#8217;s clear that you&#8217;d be best served by either working to reduce your memory footprint or simply increasing the amount of memory available to your VPS.<\/em><\/p>\n<p>We&#8217;ve put together some documentation that can help you troubleshoot and even reduce your current memory usage:<br \/>\nhttp:\/\/wiki.dreamhost.com\/DreamHost_PS_Troubleshooting<br \/>\nhttp:\/\/wiki.dreamhost.com\/PS_Optimization<\/p>\n<p>Remember, you can visit https:\/\/panel.dreamhost.com\/index.cgi?tree=vserver.usage to scale your memory allocation up (or down) whenever you&#8217;d like!<\/p>\n<p>Strictly speaking, you don&#8217;t HAVE to take any action right now, but if your memory usage continues to routinely exceed the allocation level you&#8217;ve specified, you may experience more brief periods of downtime as your services are restarted.  You may also get sick of seeing this message in your inbox. Unfortunately there&#8217;s not much that we can do about either, so we hope you&#8217;ll consider upgrading!<\/p>\n<p>Thank you for choosing DreamHost!\n<\/p><\/blockquote>\n<p>Now, my difficulty is this: The resources are being consumed by a &#8216;bot. It&#8217;s <i>quite<\/I> evident that if I increased resources to 500 MB,  this bot would just load more and more pages making the spike higher.  I could increase to 1000 MB, and the bot would just keep loading till it hit 1000 MB and the blog went down.  I&#8217;m pretty sure there is practically no level of resources I could pay for that would make this bot stop. It only stops when the blog goes down. <\/p>\n<p>I think I have to figure out how to block the &#8216;bot and it&#8217;s &#8216;bot friends.  Today, I blocked &#8216;f1.bb.sky.com&#8217; by adding &#8220;deny from f1.bb.sky.com&#8221; to my .htaccess file. I&#8217;m also trying to block it by adding &#8220;Java&#8221; to my rewrites:  <\/p>\n<p>RewriteEngine on<br \/>\nRewriteCond %{REQUEST_FILENAME} (.+)timthumb\\.php$ [nc,or]<br \/>\nRewriteCond %{HTTP_USER_AGENT} ^Jakarta\\ Commons-HttpClient [nc,or]<br \/>\nRewriteCond %{HTTP_USER_AGENT} ^Content\\ Crawler [nc,or]<br \/>\nRewriteCond %{HTTP_USER_AGENT} ^Java [nc,or]<br \/>\nRewriteCond %{HTTP_USER_AGENT} ^Mail.RU<br \/>\nRewriteRule .* http:\/\/%{REMOTE_ADDR} [r=301,l]<\/p>\n<p>But I&#8217;m not competent at .htaccess, and I&#8217;m not sure this works. Meanwhile, blocking &#8220;f1.bb.sky.com&#8221; at least solves todays problem.<\/p>\n<p><b>So, what does this have to do with Norway?<\/b><br \/>\nUnfortunately, &#8220;f1.bb.sky.com&#8221; is not the first bot taking the blog down. I&#8217;ve been seeing huge numbers of &#8216;bots over the past month. I&#8217;ve been trying to block them. Naturally, to avoid getting blocked, the spammers who program the badly behaved bots take out accounts with ISP&#8217;s who also provide service to entirely innocent people. Evidently, in the process of blocking <i>something<\/i> I blocked Bergen, Norway. (I still don&#8217;t know which command was blocking them. I solved the problem by removing a whole bunch of blocks last night.  Was I worried the blog would overload while I slept? Yes. Did it happen? Yes.)<\/p>\n<p>To get to the point those: I apologize Bergen, Norway.  <\/p>\n<p>Meanwhile to others: It&#8217;s possible I will accidentally block someone innocent in future.  If this happens to you: Sorry.  But the alternative is the blog going down 3 times a day. (Seriously.)  If you get blocked, you will be sent to this page:<\/p>\n<p><a href=\"http:\/\/rankexploits.com\/forbidden.html\">http:\/\/rankexploits.com\/forbidden.html<\/a><br \/>\nLet me know if you <I>can&#8217;t<\/I> figure out  my email based on that page.  If not, we can work together on how to make my email more obvious to a human while not revealing it to a &#8216;bot.<\/p>\n<p>Oddly enough, you could be sent to the exact same page if the blog is overloaded.   If you are sent to that page and you are not a &#8216;bot, you should be able to figure out my email by reading that page.  That means you will be able to send me an email asking me to unblock you. However, when you email me, please help me by following the instructions to learn your IP and useragent. Then send me an email containing your IP and useragent string.  Knowing these might help me figure out how to unblock you <I>without<\/i> also letting in things like &#8220;f1.bb.sky.com&#8221; who will take down the blog. Also, if I can&#8217;t figure out the specific commands blocking you, I may also email you and ask you to help me unblock you while not letting &#8220;f1.bb.sky.com&#8221; (or his friends) swamp my blog. <\/p>\n<p>Oh. If anyone is an .htaccess whiz, let me know. There are somethings <i>only<\/i> &#8216;bots request, and I&#8217;d like to use those requests to better identify the bots.  Or if you know any tricks&#8211; tell me. I&#8217;d really like to get rid of these periodic spikes that take the blog down. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday, Bebben from Norway left this note at Jeff&#8217;s blog: Sorry for the OT, but for reasons unknown, it turns out that myself and various other Norwegians independently of each other suddenly don&#8217;t get access to Lucia&#8217;s Blackboard. We get the message &#8220;Forbidden You don&#8217;t have permission to access \/musings\/ on this server. Additionally, a &hellip; <a href=\"https:\/\/rankexploits.com\/musings\/2011\/sorry-bergen-norway\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Sorry Bergen Norway!<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[72],"tags":[412],"class_list":["post-18006","post","type-post","status-publish","format-standard","hentry","category-random","tag-bots"],"_links":{"self":[{"href":"https:\/\/rankexploits.com\/musings\/wp-json\/wp\/v2\/posts\/18006","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rankexploits.com\/musings\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rankexploits.com\/musings\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rankexploits.com\/musings\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/rankexploits.com\/musings\/wp-json\/wp\/v2\/comments?post=18006"}],"version-history":[{"count":0,"href":"https:\/\/rankexploits.com\/musings\/wp-json\/wp\/v2\/posts\/18006\/revisions"}],"wp:attachment":[{"href":"https:\/\/rankexploits.com\/musings\/wp-json\/wp\/v2\/media?parent=18006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rankexploits.com\/musings\/wp-json\/wp\/v2\/categories?post=18006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rankexploits.com\/musings\/wp-json\/wp\/v2\/tags?post=18006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}