Preference to set maximum number of searches in the queue

Is kJams missing a feature you need? Post it here! Note: if iTunes has it but kJams doesn't, it's a good bet kJams will have it, but that I just haven't gotten around to it yet. But go ahead and request it anyway!
DeusExMachina
Posts: 1293
Joined: Sun Apr 20, 2008 9:57 am
Location: Pittsburgh, PA
Contact:

Preference to set maximum number of searches in the queue

Post by DeusExMachina »

When a large number of searches are submitted simultaneously, even with the new system (thanks Dave) the whole system grinds to a halt. I am not sure about systems overall, but for my system, the magic number is three. Fewer than four, and searches proceed at a reasonable pace. Add a fourth one, though, and ALL searches, for all intents and purposes, freeze. This gets even worse if the host mistakenly submits a search, since top level searches lock the user completely out of the interface.

As such, it would be nice if a preference could be set limiting the maximum number of simultaneous searches. Any searches beyond this would enter a queue, and not be submitted to the filtering engine until the queue length dropped below the threshold. Although the user making this search will have to wait a long time for results (and thus it would be nice if queued users could get an alert to this (in the webclient <div> using the current messaging mechanism)) the amount of time would still be FAR less than if their search was actually submitted, since it would slow down ALL searches, and make theirs take even longer.

In the same regard, it would be nice if there were some way to give the host's search priority (since they actually have other things to do!) as well as to move it to a back thread, so that it did NOT lock me out of the interface for 10 seconds or more while waiting for results!

dave
Site Admin
Posts: 6688
Joined: Sun Sep 18, 2005 8:02 am
Location: Seattle
Contact:

Re: Preference to set maximum number of searches in the queu

Post by dave »

i'm actually investing my time in making searching be extremely fast, rather than investing in stop-gap, throw away code. but a good idea if i were not making search faster.

DeusExMachina
Posts: 1293
Joined: Sun Apr 20, 2008 9:57 am
Location: Pittsburgh, PA
Contact:

Re: Preference to set maximum number of searches in the queu

Post by DeusExMachina »

Well, the thing to keep in mind then is what the reason is that four searches is SIGNIFICANTLY slower than 3. If the bottleneck it not in the search routine, but somewhere else, that latency might survive even instantaneous searches using really great hash code.
If that all gets taken care of, then yeah, last brick in the wall.

dave
Site Admin
Posts: 6688
Joined: Sun Sep 18, 2005 8:02 am
Location: Seattle
Contact:

Re: Preference to set maximum number of searches in the queu

Post by dave »

Bottleneck = stupid search algorithm

DeusExMachina
Posts: 1293
Joined: Sun Apr 20, 2008 9:57 am
Location: Pittsburgh, PA
Contact:

Re: Preference to set maximum number of searches in the queu

Post by DeusExMachina »

Weird that four searches would be so much worse than three. By which I mean, if you have three searches, you can see each progress bar, um, progressing, but as soon as you submit a forth search, all four simply stop. it then can take as long as five to ten minutes to complete.

dave
Site Admin
Posts: 6688
Joined: Sun Sep 18, 2005 8:02 am
Location: Seattle
Contact:

Re: Preference to set maximum number of searches in the queu

Post by dave »

beating a dead horse.

but it's because they're all contending for the same resource.

DeusExMachina
Posts: 1293
Joined: Sun Apr 20, 2008 9:57 am
Location: Pittsburgh, PA
Contact:

Re: Preference to set maximum number of searches in the queu

Post by DeusExMachina »

Got that much, just not clear why the magic number always seems to be four. Four or more, and you're dead in the water. Three or fewer, and you're fine.

dave
Site Admin
Posts: 6688
Joined: Sun Sep 18, 2005 8:02 am
Location: Seattle
Contact:

Re: Preference to set maximum number of searches in the queu

Post by dave »

how many cores in your computer?

DeusExMachina
Posts: 1293
Joined: Sun Apr 20, 2008 9:57 am
Location: Pittsburgh, PA
Contact:

Re: Preference to set maximum number of searches in the queu

Post by DeusExMachina »

2.4GHz C2D with 4 GB of RAM, and because I have issues mounting one of my external firewire drives, I always start a night with a fresh reboot, with no other apps running (though I usually at some point launch Adium and Mail.)

dave
Site Admin
Posts: 6688
Joined: Sun Sep 18, 2005 8:02 am
Location: Seattle
Contact:

Re: Preference to set maximum number of searches in the queu

Post by dave »

sorry, i mean how many "hyperthreads"? like, i have one CPU, which has 2 cores, but each core has 2 hyperthreads. so that's 4 HTs. so mine bogs down when it hits 4, cuz that means the main thread is being pushed out.

DeusExMachina
Posts: 1293
Joined: Sun Apr 20, 2008 9:57 am
Location: Pittsburgh, PA
Contact:

Re: Preference to set maximum number of searches in the queu

Post by DeusExMachina »

Dave:
I am not quite sure what you mean. Core family processors do not support hyper-threading, which only exists in previous Pentiums, as well as the Nehalem and Westmere processors.

dave
Site Admin
Posts: 6688
Joined: Sun Sep 18, 2005 8:02 am
Location: Seattle
Contact:

Re: Preference to set maximum number of searches in the queu

Post by dave »

in the below pic, you can see i have 1 CPU, 2 cores, but the "Activity Monitor" *believes* i have 4 CPUs. i take that ti mean hyperthreads.
many_cores.png
many_cores.png (29.61 KiB) Viewed 6841 times

DeusExMachina
Posts: 1293
Joined: Sun Apr 20, 2008 9:57 am
Location: Pittsburgh, PA
Contact:

Re: Preference to set maximum number of searches in the queu

Post by DeusExMachina »

The core i series supports hyperthreading, the core and core2duo series do not.
I have two cores, that's is.
Searches work fine for the first three. Four brings it to its knees.

I am going to hack the webcode, to include a warning about submitting new searches before the previous results are in.
Last edited by DeusExMachina on Sat Jan 22, 2011 5:06 pm, edited 1 time in total.

dave
Site Admin
Posts: 6688
Joined: Sun Sep 18, 2005 8:02 am
Location: Seattle
Contact:

Re: Preference to set maximum number of searches in the queu

Post by dave »

just tell me how many CPUs your Activity Monitor shows you?

you probably know: i am, at this moment, frantically working on the SQL database. all other work is halted! so: wicked fast searching coming very soon! (on the order of weeks)

-dave

DeusExMachina
Posts: 1293
Joined: Sun Apr 20, 2008 9:57 am
Location: Pittsburgh, PA
Contact:

Re: Preference to set maximum number of searches in the queu

Post by DeusExMachina »

I am listed with two. This is most likely the case for anyone with a CD or C2D, since they do not support virtual cores a la hyperthreading.

Post Reply