Archive for September 2007

Solving reliability and scalability problems with iSCSI, part 2

See Solving reliability and scalability problems with iSCSI, part 1 article.

The latest stable IET release, 0.4.15, suffers yet another misfeature: it will likely break all initiators when the ietd process is restarted (ietd restart, machine restart etc.).

This is because on ietd shutdown, the user space daemon is just killed, but it doesn’t have the corresponding signal handler and the kernel space module doesn’t perform any cleanups for it.

From initiator’s perspective, several things may happen:

  • the change will happen so fast that the initiator won’t notice anything
  • initiator will break the connection, but after reconnection, you will see your iSCSI drives remounted read-only, weird hangs etc.
  • initiator won’t be able to connect again

Of course, no one wants to have the filesystem remounted read only, or to have the hard drive ripped off from a working system (this is how it looks from the perspective of the kernel if we loose a iSCSI connection).

There is a simple solution to that, although some may say it’s an ugly hack.

Continue reading ‘Solving reliability and scalability problems with iSCSI, part 2’ »

diff: memory exhausted

Yesterday, I tried to make a diff of two ~800 MB big files on a machine with 1 GB RAM – unfortunately, it didn’t work:

# diff -u full/2007-09-25-full.sql incr/incr.sql
diff: memory exhausted

After some googling and looking through various blogs and articles, it appeared to me that GNU diff just works like that – wants to load both files in memory. So, perhaps adding some more space would help?

# dd if=/dev/zero of=/swapfile bs=1024 count=5242800
# mkswap /swapfile
# swapon /swapfile

Indeed, it helped – I was able to make a diff of these two ~800 MB files. However, as soon as I tried to make a diff of ~1 GB files, diff again exited with “memory exhausted” message.

I tried a number of tools, but none of them was giving the output I wanted (similar to that of diff -u).

As I needed that diff for backup only, in the end, I use xdelta tool:

# xdelta delta -9 full/2007-09-25-full.sql incr/incr.sql 2007-09-25-sql.delta

It gives a binary delta file, but is able to produce it using much less memory than diff.

Ooh, and if your files are so big that xdelta is failing for you…

# xdelta delta -9 full/2008-06-01-full.sql incr/incr.sql 2008-06-02-incr.delta.temp
xdelta: mmap failed: Cannot allocate memory

…you may consider using xdelta3. The deltas it produces are a big bigger, but it works much better (read: does not fail) with large files. Syntax:

# xdelta3 -9 -f -e -s full/2008-06-01-full.sql incr/incr.sql 2008-06-02-incr.delta.temp

Still, it would be great to have a tool which could produce diff -u -style output for large files.

Just how (un)reliable is Netcraft?

According to Netcraft statistics, Apache is loosing its market share to Microsoft’s IIS since almost the beginning of 2006:

Netcraft Web server Survey

In Mid 2006, the change was really dramatic, and since then, there were countless articles which tried to explain why Apache looses its market share, while IIS have massive gains.

I’ve seen conspiracy theories which claimed that Microsoft pays Netcraft. There were reports of massive “parked” domain blocks hosted on Linux being moved to Windows, or lower TCO of IIS when compared to Apache. Lack of GUI in Apache, superior ASP.NET, release of Windows Vista, you name it. Perhaps just IIS gains more than Apache. Continue reading ‘Just how (un)reliable is Netcraft?’ »

Samba says: client-error-not-authorized

Today I noticed non-admin users can’t print on a new Samba server. Samba log for a given host would just say: client-error-not-authorized. Turned out, it’s a CUPS configuration problem, so let’s write a short article about it.

Normally one configures Samba to use a CUPS server running on the same host. When a user wants to print anything, Samba uses a username/password to access the CUPS server. After authorization checks are successful, Samba connects to CUPS as root, and thus, bypasses all security checks (they were done just a while ago with username/password).

Continue reading ‘Samba says: client-error-not-authorized’ »

The smallest Windows domain controller on Earth

FSG-3For some time, I’ve been playing with Debian on Freecom FSG-3. The device is quite cool – a size of a book, with built-in HDD, 4 ethernet ports, 4 USB ports, 64 MB RAM, and 266 MHz Intel XScale CPU (ARM). With these specs, it’s more powerful than some smaller servers from the late 1990s.

Why not run a full blown Windows domain controller for a group of small office branches?

Continue reading ‘The smallest Windows domain controller on Earth’ »

Solving reliability and scalability problems with iSCSI

Because datacenters are very dependent on iSCSI, with an increasing amount of diskless servers booted directly off iSCSI NAS devices, a rock-solid operation of iSCSI is mandatory. The system should not fail even if the connection between iSCSI target and initiator is broken.

Continue reading ‘Solving reliability and scalability problems with iSCSI’ »