create multiple servers, each with only this iipsrv.fcgi on port 9000
put load balancer like nginx in front of this ensemble
What I've noticed:
when the server has multiple cpu cores, there is an equal number of iipsrv instances. Otherwise, it is just a single process. It this done by spawn-fcig, or is this local decision by iipsrv? It looks like there is a single master process, and n - 1 children (n = number of cores).
when I start iipsrv with option "-F 10" from spawn-fcgi, 10 separate iipsrv instances are created, and it looks like incoming requests are distributed among them. But I cannot see who is doing this delegation. One of the processes? spawn-fcgi not, because that process disappears from sight .. Not sure if this is intended use. Is it even needed to start multiple instances to have parallel processing?
Any idea?
Thanks in advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
when the server has multiple cpu cores, there is an equal number of iipsrv instances
iipsrv does threading internally for its various image processing routines through OpenMP, so this is probably what you are seeing here.
when I start iipsrv with option "-F 10" from spawn-fcgi, 10 separate iipsrv instances are created
When you use -F it's spawn-fcgi which does the delegation and load-balancing. Normally, the spawn-fcgi process should remain alive to handle this.
If you want to start multiple instances, spawn-fcgi is a good solution. You can start iipsrv instances directly and without spawn-fcgi, but in that case each instance will need to be bound to a different port.
But are you sure you really need 10 instances of iipsrv? Before doing this, make sure you are using things like Memcached and try to determine what, if anything, is causing any slowness in the system. Often IO on iipsrv will be disk-bound rather than CPU-bound, so having extra instances won't necessarily help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No, I do not really need 10 instances on the same server. I was just trying to understand the different options ;-)
This is the situation on my server
[root@pamuk0 DEVELOPMENT njfranck]#psaux|grepspawnroot294090.00.0112708976pts/0S+15:380:00grep--color=auto spawn[root@pamuk0 DEVELOPMENT njfranck]#psaux|grepiipsrvroot294160.00.0112708976pts/0S+15:380:00grep--color=auto iipsrviip318660.00.1359164584?Ss03:190:00/usr/lib64/cgi-bin/iipsrv.fcgiiip318670.00.1359124592?Ss03:190:00/usr/lib64/cgi-bin/iipsrv.fcgiiip318680.00.1355364200?Ss03:190:00/usr/lib64/cgi-bin/iipsrv.fcgiiip318690.00.1355444220?Ss03:190:00/usr/lib64/cgi-bin/iipsrv.fcgi[root@pamuk0 DEVELOPMENT njfranck]#systemctlstatusiipsrv●iipsrv.service-iipsrvLoaded:loaded(/etc/systemd/system/iipsrv.service;enabled;vendorpreset:disabled)Active:active(running)sinceWed2020-10-2803:19:01CET;12hagoProcess:31865ExecStart=/bin/spawn-fcgi-f$IIP_SRV-U$IIP_USER-u$IIP_USER-a$IIP_HOST-p$IIP_PORT-P$PIDFILE-F4(code=exited,status=0/SUCCESS)MainPID:31866(iipsrv.fcgi)CGroup:/system.slice/iipsrv.service├─31866/usr/lib64/cgi-bin/iipsrv.fcgi├─31867/usr/lib64/cgi-bin/iipsrv.fcgi├─31868/usr/lib64/cgi-bin/iipsrv.fcgi└─31869/usr/lib64/cgi-bin/iipsrv.fcgiOct2803:19:01pamuk0.ugent.besystemd[1]:Stoppediipsrv.Oct2803:19:01pamuk0.ugent.besystemd[1]:Startingiipsrv...Oct2803:19:01pamuk0.ugent.bespawn-fcgi[31865]:spawn-fcgi:childspawnedsuccessfully:PID:31866Oct2803:19:01pamuk0.ugent.bespawn-fcgi[31865]:spawn-fcgi:childspawnedsuccessfully:PID:31867Oct2803:19:01pamuk0.ugent.bespawn-fcgi[31865]:spawn-fcgi:childspawnedsuccessfully:PID:31868Oct2803:19:01pamuk0.ugent.bespawn-fcgi[31865]:spawn-fcgi:childspawnedsuccessfully:PID:31869Oct2803:19:01pamuk0.ugent.besystemd[1]:Startediipsrv.[root@pamuk0 DEVELOPMENT njfranck]#
So spawn-fcgi has spawned a list of iipsrv instances, but ends itself.
I debugged with strace to look if all of these instances receive requests,
and they do, and not all at once, but only one at a time, so someone is
doing delegation, and it is not spawn-fcgi...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What is the best way to setup a list of iipsrv instances?
What I've done so far, on a centos 7 server:
What I've noticed:
Any idea?
Thanks in advance.
iipsrv does threading internally for its various image processing routines through OpenMP, so this is probably what you are seeing here.
When you use -F it's spawn-fcgi which does the delegation and load-balancing. Normally, the spawn-fcgi process should remain alive to handle this.
If you want to start multiple instances, spawn-fcgi is a good solution. You can start iipsrv instances directly and without spawn-fcgi, but in that case each instance will need to be bound to a different port.
An alternative solution to using systemd is supervisor, which can also be used to start multiple iipsrv instances on a single port. There's information on how to do this in the server documentation: https://iipimage.sourceforge.io/documentation/server/#process
But are you sure you really need 10 instances of iipsrv? Before doing this, make sure you are using things like Memcached and try to determine what, if anything, is causing any slowness in the system. Often IO on iipsrv will be disk-bound rather than CPU-bound, so having extra instances won't necessarily help.
No, I do not really need 10 instances on the same server. I was just trying to understand the different options ;-)
This is the situation on my server
So spawn-fcgi has spawned a list of iipsrv instances, but ends itself.
I debugged with strace to look if all of these instances receive requests,
and they do, and not all at once, but only one at a time, so someone is
doing delegation, and it is not spawn-fcgi...