A few modifications for the postgres "insert into"
queries found in base_cache.inc.php I need a second
pair of eyes to insure that my modifications work
exactly like the originals, just faster.
Your modifications work exactly like originals(I mean -
doesn't break anything),
I made some benchmarks using psql \timing on tcp events to
see speed changes.
On pentium3 700mhz with bunch of memory:
6000 Alerts: original query: ~1030ms, your query: ~990ms
3000 Alerts: original query: ~530ms, your query: ~510ms
1400 Alerts: original query: ~250ms, your query: ~245ms
On soekris4801 223mhz with few mb of memory:
150 Alerts: original query: ~400ms, your query: ~550ms
400 Alerts: original query: ~700ms, your query: ~850ms
2500 Alerts: original query: ~4320, your query: ~3560ms
It seems that on faster systems, which has many alerts you
could feel difference.
How much alerts are on your system?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
On soekris4801 223mhz with few mb of memory:
err:
2500 Alerts: original query: ~3560ms, your query: ~4320ms
plus:
7000 Alerts: original query: ~9150ms, your query: ~9250ms
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
With the rates you are showing me, I must have something set
up wrong. On my 2 ghz, 64 bit AMD, with 1 gig of memory,
i'm getting about 4000 tcp alerts in 9156ms. Not even close
to your 700mhz machine.
Now I have to go figure out what I messed up.
Thanks for the input.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=1429350
I could take a look.
What this patch does?
p.s. unified diff would be nicer
A patch with modified queries to speed up caching.
Logged In: YES
user_id=1426836
The original queries made my system running postgres never
complete the query.
The changes are to the joins on the sub-queries. They sped
up the queries considerably on my system.
I think I got a unified diff posted now (if you haven't
already done it yourself).
Logged In: YES
user_id=1429350
Your modifications work exactly like originals(I mean -
doesn't break anything),
I made some benchmarks using psql \timing on tcp events to
see speed changes.
On pentium3 700mhz with bunch of memory:
6000 Alerts: original query: ~1030ms, your query: ~990ms
3000 Alerts: original query: ~530ms, your query: ~510ms
1400 Alerts: original query: ~250ms, your query: ~245ms
On soekris4801 223mhz with few mb of memory:
150 Alerts: original query: ~400ms, your query: ~550ms
400 Alerts: original query: ~700ms, your query: ~850ms
2500 Alerts: original query: ~4320, your query: ~3560ms
It seems that on faster systems, which has many alerts you
could feel difference.
How much alerts are on your system?
Logged In: YES
user_id=1429350
On soekris4801 223mhz with few mb of memory:
err:
2500 Alerts: original query: ~3560ms, your query: ~4320ms
plus:
7000 Alerts: original query: ~9150ms, your query: ~9250ms
Logged In: YES
user_id=1426836
With the rates you are showing me, I must have something set
up wrong. On my 2 ghz, 64 bit AMD, with 1 gig of memory,
i'm getting about 4000 tcp alerts in 9156ms. Not even close
to your 700mhz machine.
Now I have to go figure out what I messed up.
Thanks for the input.
Logged In: YES
user_id=1429350
Default postgres.conf config is written to run on slowest pc
with minumum of ram.
On your machine postgres should fly using basic performance
configuration tips:
http://www.varlena.com/varlena/GeneralBits/Tidbits/perf.html