Top posts

Posts in Internet


Memory issues finally solved

Posted by Jongerius under Development, Internet
1 Star2 Stars3 Stars4 Stars5 Stars6 Stars (No Ratings Yet)
Loading ... Loading ...

As I posted before in ‘Mysterious problems with my VPS’, I recently got an increasingly unstable VPS system hosting a lot of my and my customers sites. After a lot of digging I initially presumed that Dovecot (the mail server) was responsible for the issues, as you can read in ‘Dovecot causing memory issues’.

Last week I did a lot of debugging on the Debian server to try and find out what was the issue. And initially it was Dovecots memory usage. After disabling this tool for a couple of days the server was still running fine. However the day after I posted the article on Dovecot the server crashed again. So I had to restart my investigation.

First off I had to had to get a better memory management tool, so I installed Htop on the server (apt-get htop). This shows the current memory usage of each running application. After installing this I enabled all services and applications again and started running stress tests. And though Dovecot was causing some peeks in memory usage it did not keep the high memory usage after the requests where done.

As it turns out for some reason Apache 2.2 was using a lot of memory during peak loads. But even more frustrating it didn’t seem to release any memory any more. Which was causing issues for services that only spawn when they are being accessed like Dovecot and Postfix, which explained why both of these services crashed when the server halted.

After tweaking the maximum amount of servers Apache is allowed to start and the maximum amount of client threads to handle the memory usage dropped dramatically. And I am very happy to report that the server has been running again for more then a week, without any glitches.

Still it doesn’t explain why all of this only happened after updating my server with the latest versions and patches. But I’m glad it’s solved for now.


Dovecot causing memory issues?

Posted by Jongerius under Development, Internet
1 Star2 Stars3 Stars4 Stars5 Stars6 Stars (No Ratings Yet)
Loading ... Loading ...

In my previous post I mentioned that I had and still am having some serious issues with the stability of the VPS I’m running all of my websites on. Though I’m still a long way away from solving the issue, I have figured out that it is very likely caused by an upgrade of Dovecot.

Why I believe that dovecot is slowely over time eating up memory, well after I disabled it the VPS continued running without any issues. I already knew Apache 2, subversion and MySQL weren’t causing it. So I only had postfix and dovecot left to test.

What is truly amazing is that the website for Dovecot indicates it is low in memory consumption, hence it has no settings to limit the amount of memory allocated for Dovecot. So I still need to figure that part out, or alternatively change to a different IMAP server.


Postfix, MySQL setup a blackhole

Posted by Jongerius under Development, General Rant, Internet
1 Star2 Stars3 Stars4 Stars5 Stars6 Stars (No Ratings Yet)
Loading ... Loading ...

In previous articles I got into how to setup Postfix and Dovecot using MySQL for management. Well this time round a question rose about creating a blackhole. Which is basically a catch all e-mail address that dumps all mail coming in.

Doing this in the MySql setup created before should be relatively easy. First of modify the ‘/etc/aliasses‘ file and add ‘devnull: /dev/null‘. This will add a virtual debian user called devnull to the system. Keep in mind this alias is not yet active. To activate it run: newaliases. This will compile the file and load it into the memory.

Now open either PostfixAdmin or MySql and add an alias from ‘@domain.com’ to ‘devnull’. Which will catch all e-mail sent to domain.com and store it into the file belonging to user devnull, which in our case is the blackhole :) .

Please be carefull, as all mail sent to the domain will be dropped unless either an alias or a mailbox is defined for the domain.


Using Ajax in your website

Posted by Jongerius under Development, Internet, Webdevelopment
1 Star2 Stars3 Stars4 Stars5 Stars6 Stars (No Ratings Yet)
Loading ... Loading ...

I noticed something when I went through the posts I created on this blog. I have been raving for and against Ajax in several posts. Ranging from whether or not you should include Ajax for usability, how to work with Ajax in combination with forms and my personal favorite if you should use Ajax at all. Please keep in mind that this last post is really old already and probably a bit outdated.

Looking through all of these posts I noticed that even though I talked quite some bit about Ajax I never actually gave any examples of how to implement it. So today I will correct this mistake ;)

A simplified explanation of what Ajax is

It’s probably best to first give a very brief explanation of what Ajax is and how you could use it to create more dynamic and user interactive web pages. So what is Ajax actually. Well in a nutshell it’s a JavaScript implementation of communicating between the browser and the web server without having to reload an Internet page.

You can create a good impression of how it works by thinking about this as follows. In an traditional website each action a user takes will cause the browser to call a page on the web server. The web server then generates the full HTML for that page and returns it to the browser. This is visible to the user as the page they are looking at will ‘refresh’. Ajax is a technique to call the web server without reloading a page or redirecting to a new page. Hence fetching new content to an already displayed page in the browser. See the image below for a graphical overview of the communication between the browser and the web server during a typical Ajax call.

Ajax Interaction diagram

This gives you the change to greatly enhance your existing website with new features. Loading in content area’s on the fly. Submitting forms to the server without having to redirect the user, you name it and you can do it with Ajax. There are some limitations, but most of those are covered in my initial articles on this blog.

Multiple browsers, multiple problems

One of the first things I should probably try and explain is that every browser seems to have a different way of implementing the Ajax object. On its own this is not a big issue, but you need to keep track of this fact when you build some form of Ajax functionality in your website.

So creating the Ajax object needed to perform these calls to the web site has to be done with some try and catch work. Below is an example of how to create the Ajax object, supported by most of the popular browsers. In the example we first try and create the Ajax object for the Internet Explorer, which uses ActiveX objects.

try
{
// try to allocate the ActiveX object used by Internet Explorer
this.xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
this.xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
this.xmlHttp = false;
}
}

if (!this.xmlHttp && typeof XMLHttpRequest!='undefined')
{
// fallback for Firefox and other Mozilla based clients
this.xmlHttp = new XMLHttpRequest();
}

After executing this code (keep in mind it is JavaScript so put it in a script block in the HTML) you should have the Ajax object available in this.xmlHttp. It may be useful to know a little more about the object functions before continuing the example. The Ajax object has the following functions:

  • .status,
    returns the current status of the page. This is after the result is returned from the web server. (Status 200 is good)
  • .responseText,
    contains the result that was sent by the webserver after the url was called
  • .open(protocol, url, asynchronized),
    will open the connection to the web server and start the call
  • .onreadystatechange,
    the event that gets triggered by the Ajax object during the call to the webserver. This will be called multiple times, especially in Internet Explorer. (Possible status: 2 = busy, 4 = done)
  • .send,
    send the request to the server and wait for the result (or not if asynchronized call was selected)

A basic call to the webserver

After initializing the Ajax object you can perform any call to the webserver you’d like. The example below will show you how to open an web page and display the result into a message box. What the content is that is returned is not relevant for the functioning of the example.

this.xmlHttp.open('GET', 'http://www.example.com/page.html', false);
this.xmlHttp.onreadystatechange = function()
{
if (self.xmlHttp.readyState == 4)
{
alert(self.xmlHttp.responseText);
}
}
this.xmlHttp.send(null);

As you can see this is a very basic example, but it does show exactly how to use the Ajax technology. You can apply this logic for loading in new content on the fly, or just preloading some stuff.


Corel WinDVD 9 Blue-Ray error =38

Posted by Jongerius under Internet
1 Star2 Stars3 Stars4 Stars5 Stars6 Stars (1 votes, average: 5 out of 6)
Loading ... Loading ...

I love playing DVD’s on my MediaCenter. Well until very recently I used WinDVD to do so, which worked out perfect. Supporting HD-DVD / BlueRay and normal DVD. Recently I got the error =38 every single time when I started out the WinDVD application.

At first you might think that you may have to restart or that something went wrong during the loading of the application. But the problem kept occurring even after rebooting several times. Just to make sure that it had nothing to do with the computer I re-installed. But allas the problem remained.

So the internet became my best friend. I started searching for the error, unfortunately I found nothing exactly describing what is going wrong. But I did found some obscure reference to a new authentication and license service that Corel is including in it’s newest products.

Damn the windows services

Then I rememberd something. A little while back I optimized the computer to perform better. One of the usuall things I do is disable programs to startup and services to start. Mostly those that I do not recognize. One of the services I disabled was the ‘Protexis Licensing V2′ service. I now that I read something about this on the Internet in relation to the Corel Applications.

So just for fun I enabled the services and started it up. And sure as hell, no more errors when I started WinDVD 9. Problem solved ;)

As to why Corel opted to such obscure error messages is beyond me. Just give me a clear error stating that the Licensing service is not running. At least then I know what to do! :)

Next Page »