> Rodney Broom wrote:
>
> Hi all,
>
> I'd like a way to store complex data structures across Apache processes. I've looked
>at Apache::DBI for an example: my tests say that he has to
> create a new dbh for every process. I've looked at IPC::Shareable, but it has to
>copy data. Meaning that I can only have a certain amount
> of complexity to my data structures.
>
I you like MLDBM, I created MLDBM::Sync for the purpose
of using in Apache like environments. MLDBM::Sync creates
a file locking wrapper around underlying dbms like DB_File,
GDBM_File, or SDBM_File.
Try the bench/bench_sync.pl on your platform for some comparison
numbers. Below are the numbers I get on my platform,
Linux PIII-450x2
--Josh
_________________________________________________________________
Joshua Chamas Chamas Enterprises Inc.
NodeWorks <- Web Link Checking Huntington Beach, CA USA
http://www.nodeworks.com 1-714-625-4051
=== INSERT OF 50 BYTE RECORDS ===
Time for 100 writes + 100 reads for SDBM_File 0.15 seconds
12288 bytes
Time for 100 writes + 100 reads for MLDBM::Sync::SDBM_File 0.17 seconds
12288 bytes
Time for 100 writes + 100 reads for GDBM_File 3.30 seconds
18066 bytes
Time for 100 writes + 100 reads for DB_File 4.32 seconds
20480 bytes
=== INSERT OF 500 BYTE RECORDS ===
Time for 100 writes + 100 reads for SDBM_File 0.18 seconds
771072 bytes
Time for 100 writes + 100 reads for MLDBM::Sync::SDBM_File 0.58 seconds
110592 bytes
Time for 100 writes + 100 reads for GDBM_File 3.42 seconds
63472 bytes
Time for 100 writes + 100 reads for DB_File 4.32 seconds
81920 bytes
=== INSERT OF 5000 BYTE RECORDS ===
(skipping test for SDBM_File 1024 byte limit)
Time for 100 writes + 100 reads for MLDBM::Sync::SDBM_File 1.39 seconds
1850368 bytes
Time for 100 writes + 100 reads for GDBM_File 4.63 seconds
832400 bytes
Time for 100 writes + 100 reads for DB_File 5.73 seconds
839680 bytes
=== INSERT OF 20000 BYTE RECORDS ===
(skipping test for SDBM_File 1024 byte limit)
Time for 100 writes + 100 reads for MLDBM::Sync::SDBM_File 4.83 seconds
8304640 bytes
Time for 100 writes + 100 reads for GDBM_File 4.65 seconds
2063912 bytes
Time for 100 writes + 100 reads for DB_File 6.48 seconds
2068480 bytes
=== INSERT OF 50000 BYTE RECORDS ===
(skipping test for SDBM_File 1024 byte limit)
Time for 100 writes + 100 reads for MLDBM::Sync::SDBM_File 12.86 seconds
16192512 bytes
Time for 100 writes + 100 reads for GDBM_File 5.68 seconds
5337944 bytes
Time for 100 writes + 100 reads for DB_File 6.87 seconds
5345280 bytes