Product Documentation

Knowledgebase

Previous Topic

Next Topic

Linux

In This Section

CPUs Report Different Times on Linux, Causing Unexpectedly Long sleep() Times

Compiling FairCom DB SQL PHP on Linux/Unix

Memory Use of Linux Processes

Previous Topic

Next Topic

CPUs Report Different Times on Linux, Causing Unexpectedly Long sleep() Times

On a multi-core system running CentOS Linux, calls to sleep() were observed to take an unexpectedly long time. It is believed the system time reported by the CPUs varies, as was confirmed by this experiment:

The Linux taskset utility can be used to run a process on specified CPUs. The date on each CPU differed:

taskset -c 0 date

taskset -c 1 date

taskset -c 2 date

taskset -c 3 date

Mon Aug 8 11:20:04 CDT 2011

Mon Aug 8 11:20:19 CDT 2011

Mon Aug 8 11:20:16 CDT 2011

Mon Aug 8 11:20:20 CDT 2011

The Hyper-V VM was used in this case and it was found that adding the following boot options resolved the problem, as described here:

http://hardanswers.net/correct-clock-drift-in-centos-hyper-v

divider=10 clocksource=acpi_pm (for 32bit kernel)

Previous Topic

Next Topic

Compiling FairCom DB SQL PHP on Linux/Unix

FairCom DB SQL PHP is provided as a ready to go driver for currently available versions of PHP. However, PHP regularly advances, and new versions out pace current support quickly. In that case, you usually have to rebuild the PHP driver to match the specific version of PHP in your environment.

Usually, you can simply execute our provided build script from the /src directory of your FairCom DB SQL PHP driver installation:

> phpize

> ./configure --make-ctsql

> make

> make install

However, you may find that the configure scripts don't always match the current autotools version of your Linux flavor. In that case, you need to regenerate the ./configure script. Consider the following sequence. Actual steps may differ slightly depending on your autotools version and Linux flavor. Check with the autotools documentation for details.

> phpize

> libtoolize

> aclocal

> autoreconf -i

> ./configure --make-ctsql

> make

> make install (optional)

The driver will be in the newly created /modules folder. You are free to copy this to an appropriate library location in your environment.

Note: You may need elevated privileges to install this into /lib or other system locations.

Previous Topic

Next Topic

Memory Use of Linux Processes

When examining memory use for a Linux process, there are utilities available in addition to top. A recommended utility found useful in determining actual memory usage is pmap.

pmap -x <ctree_pid>

Here's top output for a ctreesql process:

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

1493 fctech 17 0 515m 227m 4836 S 0.0 11.3 0:00.28 ctreesql

Here's pmap output for this process. In this case, the VIRT and RES values shown by top are close to the Kbytes and RSS values from pmap. The "[ anon ]" mappings are likely to be the most common ones. FairCom DB allocations from the heap will show up as that type.

1493: ./ctreesql

Address Kbytes RSS Dirty Mode Mapping

0000000000400000 4 4 0 r-x-- ctreesql

0000000000600000 4 4 4 rw--- ctreesql

000000000b8ec000 238152 220112 220112 rw--- [ anon ]

0000003403e00000 112 100 0 r-x-- ld-2.5.so

000000340401c000 4 4 4 r---- ld-2.5.so

000000340401d000 4 4 4 rw--- ld-2.5.so

0000003404200000 1340 500 0 r-x-- libc-2.5.so

000000340434f000 2048 0 0 ----- libc-2.5.so

000000340454f000 16 16 8 r---- libc-2.5.so

0000003404553000 4 4 4 rw--- libc-2.5.so

0000003404554000 20 20 20 rw--- [ anon ]

0000003404600000 8 8 0 r-x-- libdl-2.5.so

0000003404602000 2048 0 0 ----- libdl-2.5.so

0000003404802000 4 4 4 r---- libdl-2.5.so

0000003404803000 4 4 4 rw--- libdl-2.5.so

0000003404a00000 520 64 0 r-x-- libm-2.5.so

0000003404a82000 2044 0 0 ----- libm-2.5.so

0000003404c81000 4 4 4 r---- libm-2.5.so

0000003404c82000 4 4 4 rw--- libm-2.5.so

0000003404e00000 88 80 0 r-x-- libpthread-2.5.so

0000003404e16000 2048 0 0 ----- libpthread-2.5.so

0000003405016000 4 4 4 r---- libpthread-2.5.so

0000003405017000 4 4 4 rw--- libpthread-2.5.so

0000003405018000 16 4 4 rw--- [ anon ]

0000003405200000 28 16 0 r-x-- librt-2.5.so

0000003405207000 2048 0 0 ----- librt-2.5.so

0000003405407000 4 4 4 r---- librt-2.5.so

0000003405408000 4 4 4 rw--- librt-2.5.so

0000003405600000 80 12 0 r-x-- libz.so.1.2.3

0000003405614000 2044 0 0 ----- libz.so.1.2.3

0000003405813000 4 4 4 rw--- libz.so.1.2.3

0000003405a00000 84 44 0 r-x-- libselinux.so.1

0000003405a15000 2048 0 0 ----- libselinux.so.1

0000003405c15000 8 8 8 rw--- libselinux.so.1

0000003405c17000 4 4 4 rw--- [ anon ]

0000003405e00000 236 20 0 r-x-- libsepol.so.1

0000003405e3b000 2048 0 0 ----- libsepol.so.1

000000340603b000 4 4 4 rw--- libsepol.so.1

000000340603c000 40 0 0 rw--- [ anon ]

0000003406e00000 628 68 0 r-x-- libglib-2.0.so.0.1200.3

0000003406e9d000 2044 0 0 ----- libglib-2.0.so.0.1200.3

000000340709c000 8 8 8 rw--- libglib-2.0.so.0.1200.3

0000003407200000 84 24 0 r-x-- libnsl-2.5.so

0000003407215000 2044 0 0 ----- libnsl-2.5.so

0000003407414000 4 4 4 r---- libnsl-2.5.so

0000003407415000 4 4 4 rw--- libnsl-2.5.so

0000003407416000 8 0 0 rw--- [ anon ]

0000003408200000 8 8 0 r-x-- libcom_err.so.2.1

0000003408202000 2044 0 0 ----- libcom_err.so.2.1

0000003408401000 4 4 4 rw--- libcom_err.so.2.1

0000003408600000 68 20 0 r-x-- libresolv-2.5.so

0000003408611000 2048 0 0 ----- libresolv-2.5.so

0000003408811000 4 4 4 r---- libresolv-2.5.so

0000003408812000 4 4 4 rw--- libresolv-2.5.so

0000003408813000 8 0 0 rw--- [ anon ]

0000003408a00000 580 88 0 r-x-- libkrb5.so.3.3

0000003408a91000 2048 0 0 ----- libkrb5.so.3.3

0000003408c91000 16 16 12 rw--- libkrb5.so.3.3

0000003408e00000 8 4 0 r-x-- libkeyutils-1.2.so

0000003408e02000 2044 0 0 ----- libkeyutils-1.2.so

0000003409001000 4 4 4 rw--- libkeyutils-1.2.so

0000003409600000 32 16 0 r-x-- libkrb5support.so.0.1

0000003409608000 2044 0 0 ----- libkrb5support.so.0.1

0000003409807000 4 4 4 rw--- libkrb5support.so.0.1

0000003409a00000 176 40 0 r-x-- libgssapi_krb5.so.2.2

0000003409a2c000 2048 0 0 ----- libgssapi_krb5.so.2.2

0000003409c2c000 8 8 8 rw--- libgssapi_krb5.so.2.2

0000003409e00000 144 28 0 r-x-- libk5crypto.so.3.1

0000003409e24000 2044 0 0 ----- libk5crypto.so.3.1

000000340a023000 8 8 8 rw--- libk5crypto.so.3.1

0000003412000000 52 36 0 r-x-- libgcc_s-4.1.2-20080825.so.1

000000341200d000 2048 0 0 ----- libgcc_s-4.1.2-20080825.so.1

000000341220d000 4 4 4 rw--- libgcc_s-4.1.2-20080825.so.1

0000003416c00000 920 412 0 r-x-- libstdc++.so.6.0.8

0000003416ce6000 2044 0 0 ----- libstdc++.so.6.0.8

0000003416ee5000 24 24 20 r---- libstdc++.so.6.0.8

0000003416eeb000 12 12 12 rw--- libstdc++.so.6.0.8

0000003416eee000 72 8 8 rw--- [ anon ]

0000003417000000 312 44 0 r-x-- libncurses.so.5.5

000000341704e000 2048 0 0 ----- libncurses.so.5.5

000000341724e000 56 12 8 rw--- libncurses.so.5.5

000000341725c000 4 0 0 rw--- [ anon ]

000000394a800000 1204 232 0 r-x-- libcrypto.so.0.9.8e

000000394a92d000 2044 0 0 ----- libcrypto.so.0.9.8e

000000394ab2c000 132 16 8 rw--- libcrypto.so.0.9.8e

000000394ab4d000 16 8 8 rw--- [ anon ]

000000394ac00000 288 52 0 r-x-- libssl.so.0.9.8e

000000394ac48000 2048 0 0 ----- libssl.so.0.9.8e

000000394ae48000 24 12 12 rw--- libssl.so.0.9.8e

00002ab7f38ed000 8 8 8 rw--- [ anon ]

00002ab7f38ef000 11532 2836 0 r-x-- libctreedbs.so

00002ab7f4432000 2048 0 0 ----- libctreedbs.so

00002ab7f4632000 404 328 324 rw--- libctreedbs.so

00002ab7f4697000 56368 660 652 rw--- [ anon ]

00002ab7f7dba000 5188 44 40 rw--- [ anon ]

00002ab7f82ec000 8244 6188 6188 rw--- [ anon ]

00002ab7f8b10000 40 24 0 r-x-- libnss_files-2.5.so

00002ab7f8b1a000 2044 0 0 ----- libnss_files-2.5.so

00002ab7f8d19000 4 4 4 r---- libnss_files-2.5.so

00002ab7f8d1a000 4 4 4 rw--- libnss_files-2.5.so

00002ab7f8d1b000 4 0 0 ----- [ anon ]

00002ab7f8d1c000 1536 12 12 rw--- [ anon ]

00002ab7f8e9c000 4 0 0 ----- [ anon ]

00002ab7f8e9d000 1536 8 8 rw--- [ anon ]

00002ab7f901d000 4 0 0 ----- [ anon ]

00002ab7f901e000 1536 12 12 rw--- [ anon ]

00002ab7f919e000 4 0 0 ----- [ anon ]

00002ab7f919f000 1536 8 8 rw--- [ anon ]

00002ab7fc000000 832 688 688 rw--- [ anon ]

00002ab7fc0d0000 64704 0 0 ----- [ anon ]

00002ab800000000 144 16 16 rw--- [ anon ]

00002ab800024000 65392 0 0 ----- [ anon ]

00002ab804000000 4 0 0 ----- [ anon ]

00002ab804001000 1536 12 12 rw--- [ anon ]

00002ab804181000 4 0 0 ----- [ anon ]

00002ab804182000 1536 12 12 rw--- [ anon ]

00002ab804302000 4 0 0 ----- [ anon ]

00002ab804303000 1536 16 16 rw--- [ anon ]

00002ab804483000 4 0 0 ----- [ anon ]

00002ab804484000 1536 16 16 rw--- [ anon ]

00002ab804604000 4 0 0 ----- [ anon ]

00002ab804605000 1536 16 16 rw--- [ anon ]

00002ab804785000 4 0 0 ----- [ anon ]

00002ab804786000 1536 16 16 rw--- [ anon ]

00002ab804906000 4 0 0 ----- [ anon ]

00002ab804907000 1536 20 20 rw--- [ anon ]

00002ab804a87000 4 4 4 rw-s- [ shmid=0x3d9f0008 ]

00002ab804a88000 4 0 0 ----- [ anon ]

00002ab804a89000 1536 8 8 rw--- [ anon ]

00002ab804c09000 4 0 0 ----- [ anon ]

00002ab804c0a000 1536 8 8 rw--- [ anon ]

00002ab804d8a000 4 4 4 rw-s- [ shmid=0x3d9f8009 ]

00007ffff783e000 84 44 44 rw--- [ stack ]

00007ffff79fd000 12 4 0 r-x-- [ anon ]

ffffffffff600000 8192 0 0 ----- [ anon ]

---------------- ------ ------ ------

total kB 536032 233324 228496

TOCIndex