This website is under heavy load (queue full) - amazon-web-services

I am having problems with my site in aws, it shows me the following message: "This website is under heavy load (queue full)" I was reading and apparently it is because multiple users access at the same time, I tried to modify the value of the queue but I did not find which was the file, in the end I modified the file located in /usr/lib/ruby/vendor_ruby/phusion_passenger/nginx/config_options.rb but I'm not sure if it was there that I should modify it. Modified from this:
{
:name => 'passenger_max_request_queue_size',
:scope => :application,
:type => :uinteger,
:default => DEFAULT_MAX_REQUEST_QUEUE_SIZE
},
to this:
{
:name => 'passenger_max_request_queue_size',
:scope => :application,
:type => :uinteger,
:default => 2000
},
I restarted nginx with sudo service nginx restart but I try to access the site and it is loading for a long time and fails to show the content. my application is developed with rails 5 is hosted on aws (my plan is the basic one), with passenger and nginx
My application was already working correctly but today it presented that problem.

Related

Custom Name Server Not Resolving My subdomain names via Internet (dynamic DNS)

My objective is to setup site like noip/dyndns.
I have purchased domain ( say locations.com ). In my cpanel i have redirected that into a static ip (say 128.10.10.10)
I have created subdomain (say device.locations.com) and redirected it to a another static ip
(say 128.20.20.20). This is working fine.
How ever i wish to setup dynamic DNS service in device.locations.com (128.20.20.20)
I laredy installed bibd (version 9 in Centos 7)
Probluem is :
say I have a dynamic client. Which i registered as "serial001.device.locations.com" which is having ip ( 50.50.60.1 , which will change over the time)
if i issue "dig serial001.device.locations.com" in dns server (128.20.20.20/device.locations.com ) I'll get,
;; ANSWER SECTION:
serial001.device.locations.com. 10 IN A 50.50.60.1
However if i issue "dig serial001.device.locations.com" in other machine i am not getting any answer.
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52799
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
if i specifically say to use nameserver as above (i have pointed jayaruvandns.tk to 128.20.20.20)
dig #locationsdns.tk serial001.device.locations.com
;; ANSWER SECTION:
serial001.device.locations.com. 10 IN A 50.50.60.1
Can i know how can i fix this issue?
( I am really new to DNS )
I have followed below blog.
Original Post -Build your own DynDNS
My configuration was missing DNS record in my config file
You have to add these two DNS records to your example.com nameserver:
>dyn NS ns.example.com
>ns A 203.0.113.17

How to test http requests with cljs-http using lein doo phantom

While running my tests with lein doo phantom, I receive a -1 status response and an empty string as the body. However, when I run the test in the repl, I am able to retrieve the request data with a 200 status response and the appropriate data in the body. Is this because a manytomany channel is being returned first as mentioned below, thus giving me the inappropriate response? If so, how could I account for this?
https://github.com/r0man/cljs-http#async-response-handling
I also thought maybe I need to use a timeout to wait for the request to complete. If so, how would I apply that appropriately with my existing code? It looks like cljs-http has :timeout as a parameter but I haven't been ably to get it to work appropriately (assuming this is the cause of the issue).
(deftest test-async
(async done
(go (let [response (<! (http/get "http://localhost:3000/api/user/1"
{:with-credentials? false
:query-params {"id" 1}}))]
(is (= {:status 200}
(select-keys response [:status]))))
(done))))
Since you are running your test under phantomjs. Phantomjs default disable cross domain XHR access and your tests js are running on localhost,all external ajax calls are denied.
you can set the --web-security=false to allow your test to do cross domain ajax.
In your project.clj add this
:doo {:paths {:phantom "phantomjs --web-security=false"}}
more info about phantomjs
http://phantomjs.org/api/command-line.html

Inconsistent AWS "Signature not current" errors from Cloudformation API

I have a ruby client (fog) that makes a call to the AWS CloudFormation API. The client runs on an AWS EC2 instance. For months, the client has been running without issue, but in the last 2 weeks, I've been getting random authorization failures because of "Signature not current".
Here's some cherry-picked debug details from excon (the underlying library used by fog to make http calls).
request:
:headers => {
"User-Agent" => "fog/1.24.0"
"x-amz-date" => "20150326T152500Z"
}
excon.error.response
:headers => {
"Date" => "Thu, 26 Mar 2015 15:19:28 GMT"
}
ERROR: Fog::AWS::CloudFormation::Error: SignatureDoesNotMatch => Signature not yet current: 20150326T152500Z is still later than 20150326T152429Z (20150326T151929Z + 5 min.)
Looks to me like a time sync error: the CFN API is responding with a 15:19:28 timestamp while the request on the client side (ec2 instance) has a time of 13:25:00 - just over 5 minutes ahead...
Assuming this is something that needs to be addressed by AWS... any suggestions for a workaround?
Your server has some clock drift that is causing the request signature to be invalid, or at least, not valid yet.
if Linux, Please check your ntp server is running in system or not.
service ntp start
service ntp status

Connecting to a datomic-free instance hosted on EC2 from outside AWS?

I've installed and run cldwalker's datomic-free receipe https://github.com/cldwalker/datomic-free on an EC2 instance.
;=> System started datomic:free://{EC2 private IP address}:4334/<DB-NAME>,
; storing data in: data
My free-transactor.properties file looks like this:
protocol=free
host={EC2 private IP address}
port=4334
h2-port=4335
h2-web-port=4336
I want to connect the database from outside EC2:
(require '[datomic.api :as d])
(def uri "datomic:free://{EC2 public IP address}:4334/om_async?h2-
port=4335&h2-web-port=4336&aws_secret_key={xxx}&aws_access_key_id={yyy}")
(d/create-database uri)
But I get:
clojure.lang.ExceptionInfo: Error communicating with HOST
{EC2 private IP address} on PORT 4334 :: {:timestamp 1418304487036,
:host "{EC2 private IP address}", :version "0.9.5078", :port 4334,
:username "{XXX}", :peer-version 2, :alt-host nil, :password "{YYY}",
:encrypt-channel true}
What should I do to make this work?
UPDATE:
I have found the "Free Transactor on EC2" thread in the Datomic Google Group: https://groups.google.com/d/msg/datomic/wBRZNyHm03o/0SdNhqjF27wJ
Does this means I can only connect to Datomic-free if my app run on the same server?
Would I have the same problem (not being able to access db from outside server) if I get Datomic-free hosted on linode or digitalocean?
Thanks in advance for your help!
I had a very similar problem ("Error communicating with HOST
on PORT 4334") and all I had to do was restart my computer, strangely enough. Something with the ports being tied up after having launched a local transactor, I think. Then again, you probably already tried that.
To allow remote peers access to embedded storage you must do three things:
choose two passwords for the embedded storage
set the storage-access property
add a password to the connection URI used by peers
Take a look at this link

iron.io / iron_worker scheduling task run_every is ignored....(using ruby gem),

using iron.io within rails app. their ironcasts have been really good and its pretty simple.
weird behaviour is that i've setup a scheduled task during rails startup (application.rb), i've set scheduled task to 10min (600 seconds), but the tasks are being kicked off every minute (or so, almost as if its ... as often as possible).
The tasks create and run. The first one connects to my heroku DB, but other tasks often fail (connection issue, but I think this is because its happening so quickly).
schedule = #iwclient.schedules.create("schedule", {:database => dbsettings },{:run_every => 600 } )
have I missed something?
I have tried different timings, does not seem to make a difference.
i've got debug output displaying the results of the task creation e.g. puts schedule.inspect.to_s
welcome any guidance if anyone has had similar issues
Ben
these are db settings are confirmed during iron_worker task debug output that they are correctly populated, indeed the task does execute and exit ok.
dbsettings = {
:adapter => "postgresql",
:database => "xxx",
:host => "ec2-107-20-224-35.compute-1.amazonaws.com",
:port => 5432,
:username => "xxxx",
:password => "xxx",
:sslmode => "require"}