Finally got my root domain – now with CloudFlare on!

Do all you guys found that the domain for this site has been changed? Yeah, I finally got my own root domain: Actually, I wanted my root domain for a long time but I hadn’t got enough money to buy one myself. Finally, with help of Allen Chou, my furious dreams can now come true. (There’s some payoffs after I purchased the root domain. E.g. lost my SSL certificate. I’ll talk about that in the following post.)

Now with my own domain, I can finally do something big! After this domain has been successfully activated, I can now try using a CDN service (What I’m using is CloudFlare, it’s really great!) to speed up my site. Originally with the sub-domains provided by my cloud hosting, OpenShift, I cannot leverage the power of CloudFlare’s global CDN network to speed up my site as I cannot change the DNS records of the sub-domains. Now, I can finally give CloudFlare a try and the performance speed ups are great! The response speed of my site before using CloudFlare is 266 ms and the response speed of my site now is 66 ms. What a great speed-up!

Receiving such a great speed up, I think my site will make a better impression to all the visitors. (Also, I’m sorry that I didn’t write posts as often as before as I’m also writing articles for other sites and I don’t have many time to write posts for my blog.) However, I got some problems when login to the backend. As I forced WordPress to use secure connections when login, the SSL certificate doesn’t match the new root domain I’m using. I’m forced to disable that in order to login normally. Now, it’s less secure when I login. I missed the secure connections that I used to have.

You may ask: why I don’t buy another SSL certificate so as to get the secure connections back? You need to know: SSL certificates are super expensive for a student like me. I’m so sure that I won’t be able to get my secure connections back unless I start to save some money for that.

OK that’s what I feel about my new root domain. Remember to follow-up my latest posts!

Asynchronous – Multithreading or Event Loops?

Asynchronous programming is a big hit as it does not block other code’s execution when something is ongoing. Usually, asynchronous states can be achieved in a few ways.

1. Using threads
In multi-core machines, we can spawn different threads to do different things asynchronously. However, the process of spawning threads requires time and each thread consumes memory, which may not scale well when many jobs are needed to be done. Examples are Apache and IIS.

2. Using event loops
The jobs are executed immediately and an event loop is used to check for the execution state of each job. This structure does not involve spawning threads so the memory usage is lower and can handle many jobs easily. Examples are Nginx and node.js.

Since the rise of node.js, the event loop structure has been proven to work well even with thousands or even millions of jobs. However, in multi-core machines the event loop structure cannot uses all the power provided by the CPU as only one thread (core) is used for computation. This can be solved by combining two structures to maximize the pros of them.

Sorry about the server problem

Today, OpenShift has issued to fix the security problems of their cloud and it requires server restarts. Since my blog is hosted on OpenShift, it also caused problems in my blog.

Now the problem has been fixed.

Google PageRank – the principle

I think everyone knows Google, the most known company that starts with a search engine. Every day, over 2 million search queries are being sent to Google and you get the things you want because they have special algorithms to find out the important links.

Have you wondered how can Google does that? In here I’m going to tell you how. It’s a number called PageRank that defines the importance of a page and the result is sorted according to the PageRank.

A PageRank of a page is actually the probability of a user clicking the link. Every page will be given a same PageRank when Google first indexed them. Then each time Google indexed a page, it’ll recalculate the PageRank of every page by the following rules:

  1. If the page has been linked by other sites, their PageRank will transfer to the page.
  2. Then, if there’s more page linked to the current page, a PageRank of the PageRank of the page divided by the number of link to the current page will be transferred.

Therefore, the formulae of a page’s PageRank is:

PageRank Math

(Where u denotes the current page, v denotes the pages that linked to the site u and L() is the amount of links to site u.)

This formulae helps Google to choose what is useful to the users. Also, the higher the number, the more likely a user will go to your site. This makes PageRank an important mark of how popular your site will be.