Category Archives: Story

Freezing curl causing a lot of troubles

Not-so-infinite loops

Our website monitoring mechanism is actually quite simple.  We use curl to make a connection with the website and then we grab some data to check if your site is up or down (actually, curl has more power and we use it in our new features we develop right now as well).

To make sure we are able to test your site in almost equal time intervals, we need to have a couple of testing agents working at the same time.

The job of these agents is to sit and wait for available tasks for some period of time. If there are any, agent reserves one of them and does the actual website uptime test.

However, since we started the Ukrainian and Russian government websites monitoring site (lots of downtimes), we found out that some of the scripts sometimes freeze for no good reason.

It wasn’t a serious problem, because it didn’t influence the uptime monitoring service reliability. However, the zombie agents were taking our precious server resources to do nothing.

Curl has two timeout options

And then, there comes the time when we decided to fix this issue. While debugging we found out that the solution is quite trivial.

As you probably know, we assumed that if your site is not responding in 10 seconds after our call, it means that the website is down. Nobody is waiting 10 seconds for first document request anyway. Even if your server works, the user nearby our agent’s server location might not be able to notice this.

These 10 seconds of timeout are set as a curl option (CURLOPT_CONNECTTIMEOUT). It means “if the server is not responding in X seconds, do not wait more and return connection error [http 0]”.

What we didn’t notice is the other curl option – CURLOPT_TIMEOUT and it was the cause of our problems. The option is more important in this case since it forbids curl to freeze. Connection timeout is related to the connection only. If connection is made quickly, the clock for the whole script is not ticking any more.

Summary (tl;dr)

If you plan to use a curl mechanism inside a do-while loop with iteration limit, remember to set a curlopt_timeout or your loop won’t die sometimes.

 

 

Low account and zero account notifications tweak

Fresh, spring update

Tuning up the notifications

Recently we were working on another feature that may greatly improve your user experience with our service.

In order to meet your expectations, we’ve changed our low account and zero-account notifications.

How to disable notifications?

In fact it’s quite simple. You need to pause or delete all your active tests and then you’ll no longer receive any message.

Secondary email, quick settings link and more

New features you’ll love

Last couple of weeks we’ve been tuning up the AgentSlug.com to make it even better, faster and more reliable. We’re also preparing ourselves to do a big pivot of the app by adding some cool functionalities.

Aside of planning and wireframing the big v 2.0, we’ve already made some new features which seem to be a must-have as soon as possible.

All features listed below are available since today.

Secondary emails

After the upgrade, every website test (monitoring) can be labeled with additional, secondary (alternative) email.

When site is down (or up), AgentSlug.com will send a notification to the secondary email. Even if you set “email notifications” off in your account settings. Secondary email attribute is fully independent.

User story

I’m monitoring (personally) dozen of websites within AgentSlug.com uptime monitoring service. Not all of them are important to me nor my client. Some are just triggered to grab some data from the world.

For example, after we had deployed Ukraine-Russia cyber war monitoring I got flooded with up/down notifications from monitored websites. There were so many emails, that I was forced to turn the email notifications off to my whole account to not get flooded to death.

Now, with a secondary email feature, I still have email notifications turned off as a global setting. However, I set a secondary email to every important website.

Turn off email notifications within notification itself

If you’re a hardcore AgentSlug.com user, there is some probability that you get a lot of messages from the service.

Sometimes you’re aware of a problem with your site and don’t want to get more messages anymore.

Now, you can turn them off by clicking a “turn off” link. The link is valid up to two days and works even if you’re logged out.

Turning off the email alerts

Email notification turned off alert

Just in case you forget that you turned off email alerts, we will send you an email to remind you about that.

It would be sent no more often than once a month and only if one of your sites is down. If none of your site is down, you won’t get any message. Ever.

 

Next step

Feedback is crucial

AgentSlug.com is getting more and more feedback from our first users.  Most of it is positive and that makes me happy, but what’s more important to me is that some of it is really constructive and learning.

As a developer who has decided to make a tool based on “scratching own itch” problem, I can’t be sure what are others’ needs and why they are actually using the app.  Feedback is crucial. Many thanks to everyone for their effort.

Next step

From the first deployment date we are tuning the uptime monitoring module to make it better and more optimized. However, we are about to go further than that.

AgentSlug.com is an uptime monitoring tool for now, but we want to build on it a complementary automatic webmaster tool focused on website monitoring in many dimensions:

  • full content monitoring
    • dead links detection
    • html validation
    • spell checker
    • WAI problems detection within the content (like no [alt] attributes on images)
  • anomalies detection – if your homepage suddenly grows or shrinks it might be hacked (defaced)
  • real users’ load time
  • resources load time testing

That’s just a shortlist of the ideas that we are fully agreed are important for every webmaster or website owner.

How it started

Ad hoc script

The AgentSlug.com idea went out after we were unable to use one of the biggest uptime monitoring service. I decided that I’d write my own simple ad hoc script, hooked to cron jobs. It worked quite well, and then, as you’ve probably guessed, I thought that we can extend it to a service with nice interface and some additional useful functionalities.

The very first script did just the uptime monitoring.  There was no configuration workflow. Everything was hard-coded directly on the server.

On that foundation, during the last half year, we’ve made a nice and simple uptime monitoring service.  Now we’re trying to make it even more simple.

Because uptime monitoring service seems not to be enough, we want to go further and extend the AgentSlug.com to a complementary website monitoring service. With content monitoring and other useful stuff. We’ve got some plans, but we are still gathering some feedback from our very first users.

Here is a request for you, dear visitor.  If you use or will use AgentSlug.com, don’t hesitate to contact us and tell what you think. Any opinion, any idea is really important for us and we’d love to hear it.

Let’s say hi

Hi, I’m Simon*.

I’m the founder and main developer of AgentSlug.com service. If you contact us via live chat or email, you’ll probably contact me personally.  I’m also available on twitter,  and google+.

Beside AgentSlug.com, I run a small web agency – Eskalacja.com. We work for couple of clients, other web agencies and technology companies on monthly basis.  We have lots of work.

Since January 2014 we took off the AgentSlug.com service. Now we share our time between websites we develop and the service we truly believe will be the best – complementary tool for webmasters around the globe.

* (actually it’s Szymon, but you probably won’t pronounce it right)