Jack Ma: E-commerce in China and Around the world
Category: General
黑斑吻 大马电影2013
黑斑吻 大马电影,拍摄场景,马来西亚柔佛。
拍摄地点正是我的中学母校啊!
对话解密物联网- YouTube
对话解密物联网- YouTube
HTTP Request Gateway Timeout in Linode instances
Recently I faced HTTP request timeout in one of my Linode instances, and this post will illustrate how I overcome it.
OK, to the last, this is not Linode issues, but my setting issues.
First, this is a Node JS Express System to generate report. One HTTP request came in, a backend quite long running process (over 30 seconds) is running to generate the report and return the result, and it faced HTTP request gateway timeout.
The first thing I do is to add in one Express middleware, to explicitly set the request connection timeout in every connection.
var requestTimeout=120000;
app.use(function(req, res, next) {
req.connection.setTimeout(requestTimeout);
next();
});
This code add an explicit request timeout at 120 seconds for each HTTP request to Node.JS Express system.
But this still not solving the issues, the gateway timeout still happening.
After googling, what I found this issues on Linode other people facing is related to Nginx. Then I just realized that my application frontend is using Haproxy. I quickly find the Haproxy configuration file, and modified the following line
backend domain_reporting_backend
mode http
option forwardfor
timeout server 120000
timeout connect 4000
I changed timeout server value as 120000, and restart Haproxy service. Then the request gateway timeout is gone.
The conclusion is, Linode is not putting on the request timeout limit to applications hosted on it, is not like Heroku explicitly putting 30 seconds timeout limit, which if your HTTP requests last over 30 seconds, Heroku will hang up your request and your browser will see this gateway timeout error.
Sentiment Analysis with Twitter Data Stream
I recently doing sentiment analysis with twitter data stream.
Twitter data stream flowed from real time public Twitter stream which consists of 1% of data of globally tweets flowed to Twitter at given time (by Twitter API docs). Sentiment analysis is to find out the tweets, the information posted by Twitter users, whether it is happy tweet or sad tweet, good tweet or bad tweet, based on some keywords.
I created a simple HTTP interface using Node.JS, ntwitter, sentiment library to archive this objective.
This program can start track some targets keywords, comma separated list of it. Then I can query the current status, how many tweets had been detected. I can then fetch the current Twitter raw data. The last which is the most interesting I can query the sentiment analysis which showing how many percentage there is the positive tweet and negative tweet.
From two days ago I’m trying this, I tried tracking “weather,traffic” and find that most of the KL (Malaysian) and Singaporean always stuck in jam when going works and go back from works, they always complain their own government, but most of the time the sentiment analysis still found that 50:50. Today I will try to test with “Ukraine”, the current sentiment analysis found that the negative is more than positive. I hoped that it will going positive in the next morning :).
Sheila 最长的电影
She is Sheila, a Malay, the song “The longest movie” by Jay (Famous Chinese Singer).
Robot to play Flappy Bird – YouTube
Robot to play Flappy Bird – YouTube
Using Arduino Technology, a WebCam to analyze the player screen in real time, a mechanical finger to touch the screen based on algorithm when and how to jump the bird across the obstracles.
Is it quite interesting right?
高凌风最后一首歌 如果都是天意
高凌风最后一首歌 如果都是天意 RIP
HEBE TIEN 田馥甄[ 渺小INSIGNIFICANCE ] Official MV HD
HEBE TIEN 田馥甄[ 渺小INSIGNIFICANCE ] Official MV HD
Live Accelerometer Data from iPhone
I am making fun with the live accelerometer data from iPhone, rendered using HighChart.



