Prefetch Technologies // Keeping your cache lines cozy

Archive

Posts from 2004

Finding BIND failures in OpenLDAP logfiles

databasesDec 28, 2004 1 min read

When OpenLDAP is configured to log connection information, a RESULT entry is written with the status (e.g., success or failure) of the last BIND: The "err=" string contains zero if the BIND was successful, and an error code if the BIND didn't complete successfully. The error codes are defined in "LDAPResult.h," which is included with the OpenLDAP source code. When a BIND fails because the credentials were invalid, the error string will contain the value 49: To get the DN that tried to BIND, you can grep the connection number (the value after conn=) out of the OpenLDAP logfile: You can get the IP address of the host that initiated the BIND by grepping the connection id, along with the ACCEPT keyword, from the OpenLDAP logfile: This is useful for tracking down folks who are poking around your directory server.

$ read more →

Measuring Website Page Load Times

monitoringDec 26, 2004 1 min

I was curious to see how long it would take to load "index.html" from my web server, so I created http-ping.pl to measure the time it took to retrieve a webpage from my web server: This will display the time it takes to perform the TCP three way handshake ( Syn, Syn/Ack, Ack), and GET the index page from a web server. This was a quick and dirty hack, and a full rewrite in C (w/ SSL support and timings!) is forthcoming.

$ read more →

Selectively tracing Solaris system calls

solarisDec 1, 2004 1 min

I was debugging an I/O problem last week, and needed to see how an application was using a UFS file system on a Solaris 9 server. Solaris comes with the "truss" utility, which can be used to trace library and system calls. When truss is invoked with the "-t" option, only the system calls passed to "-t" will be traced: This example is taken from an application I manage ( I didn't write it ). The application opens a log file, seeks to the end of the file, writes 133-bytes of data, and then closes the log file…

$ read more →

Checking for OpenLDAP unindexed searches

databasesNov 18, 2004 1 min

I was checking my openldap logfiles today, and noticed that the "cn" attribute wasn't indexed. I found this by checking for the "index_param" string in my OpenLDAP logfiles: To fix this problem, I added an "index" statement to my slapd.conf: Once the index was added, I rebuilt the indexes with the "slapdindex" utility: The OpenLDAP documentation has more info if you want to learn more.

$ read more →

Bash arrays

shellNov 14, 2004 1 min

I have been trying to get a better grasp of some advanced bash concepts, and have been reading through the following reference manual. I am pretty familiar with C and perl arrays, but have never had a need to use arrays in a bash script. The syntax for a bash array is almost identical to Perl: This assigns the value 12 to the first slot in the array. Since bash variables are untyped, we can assign a string to the same array: This assigns the string "my string" to slot two in the array…

$ read more →