Subject Re: 1.5.3 SS: need to run long-running queries with low prio - how?
Author Ali Gökçen
Hi Adam,

> I would avoid sleeping the thread as this could potentially cause
more
> bottlenecks then it resolves, especially if another thread has to
wait
> for the sleepy one to wake to release a lock.

I don't think so.
what bottleneck may be here?

fetch something statement
sleep for a short time (with UDF or internal cpu loop)
insert statement

bottleneck is on the DISC I/O not on the CPU.
DISC cause bottleneck because it is a mechanical device and has
unstable response(access+fetch) times.

if u use the sleeper UDF inside of a statement, it may increase time
lost because of internal locks. Select and insert statements has
short time, fast internal locks and effects minimal other users.
Also, my advice was about waiting between SQL statements, Firebird
engine will be unlocked position.

>
> If you switched to classic, then a UDF call could retrieve the
process
> ID and you could use that to change the priority class. I do not
know
> if this is advisable but it would certainly be less dangerous than
> sleeping the thread.

i think playing classic proccesses priorty very very dengerous.
firebird proccesses unawered each other for system level.
they are awered only file level mechanic lock info.
so, if you reduce some firebird process priority with giving more
priority others, this will cause disaster, because too late
releasing locked rows and system resources cause another bottleneck
with electronic level too.
which has advantage? do force to wait a user or do force every user?
My education was on system/370. multiproccessing, timesharing,
multitasking, resource sharing etc. these terms may be new for PC
based people.

>
> Remember though that there is an overhead in slowing down the
queries
> in that there is a far greater garbage buildup and any locks will
be
> around for much longer, so I find it is usually better to get it
over
> with quicker.
>
> You mention two tables and seem to toggle between them. Is there a
> reason for doing it this way? If it is just an information lookup,
> then you could put the data into a new database (on a different
> machine) and then put the database in and change the alias.
>
> Also, the hardware is relatively modest for something that is
meant to
> be both a database server, web server as well as handling data
pumping.
>
> Adam
>

Adam, imagine, there is 100 users and everybody has 10 ms to run...
somebody uses this time to prepare or calculate something on CPU and
somebody can send some hundreds read/write command to disc, because
of they have no much calculation on CPU.
in shortly, somebody works heavly on file, somebody on CPU.
DISC operations are in anarchy.
write a program, it may be even in low priorty,
only read and write something from/to HD (or CDROM) randomly other
than FDB file. you will se Firebird users will lost their responses,
it is not about CPU.

Regards.
Ali