yes, that's the one. but obviously you first have to run the installer to install a "standard type" (read: not multisite) installation. else you cannot run the test framework.
i'm off now. good luck and thanks for testing!
sphericus
Joined: 2005-11-06
Posts: 55
Posted: Mon, 2006-05-29 12:54
Will doing a standard type install break an existing multisite install? As I have done the multisite one already and created a few sites. Will doing a standard install damage the other ones at all?
Sorry if the questions are a bit silly.
Larry Menard
Joined: 2005-10-01
Posts: 757
Posted: Mon, 2006-05-29 17:57
Unfortunately I don't know jack about multi-site. Somebody else will need to answer that.
Thanks for your sanity testing. If you don't mind me asking, what tool did you use to emulate that 200 users? That sounds handy.
sphericus
Joined: 2005-11-06
Posts: 55
Posted: Mon, 2006-05-29 19:33
I used this tool, its not too bad, I normally have it generate a script based on what I do in IE. Then it plays it as many times as I want, and as fast as it can.
Also, forgot to mention that this Tool, combined with Page Detailer, I find quite useful.
valiant
Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2006-05-29 21:51
no, i standard installation won't break multisites, as long as you choose another database / storage folder for each and every installation.
sphericus
Joined: 2005-11-06
Posts: 55
Posted: Tue, 2006-05-30 08:05
Thanks,
I am trying to get all the modules up and working, will let you know once they are all up and I have the response from the unit test.
Quick question, is mod_rewrite supposed to be hard to get up? It seems to be not playing nicely with the apache module.
sphericus
Joined: 2005-11-06
Posts: 55
Posted: Tue, 2006-05-30 08:17
Actually I just realized I had to type "all" into the filter table to run the tests.
Please find the test results attached.
There are a few modules which are not installed, like ImageMagick, which I have not installed, as I could not find RPM's for SLES9 for them.
Larry Menard
Joined: 2005-10-01
Posts: 757
Posted: Tue, 2006-05-30 08:30
I find the URL rewrite config page not very self-explanatory. URL rewrite can use either the Apache module or PHP's support (you only need one of them to work). I don't even try the Apache module anymore; the PHP support works for me.
valiant
Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2006-05-30 08:41
sphericus,
you only ran 165 unit tests. we have 2200+ unittests.
you filtered the tests by the string "all" which explains it.
delete "all" and just hit enter in the empty filter input field.
sphericus
Joined: 2005-11-06
Posts: 55
Posted: Tue, 2006-05-30 10:54
Try this one, it died at test 484, with this in the apache error log
Now I have about 4000 lines of that in my error log. Don't know if it is significant
73blazer
Joined: 2006-05-12
Posts: 79
Posted: Tue, 2006-06-06 00:50
Here's another symtom of my severe performance problem.um
If more than one person is viewing the gallery, let's say I click to load an album one one computer, and my wife in the other room clicks to load a different alubum on another computer, whoever clicked first, gets to look at their page first, then second persons gets a spinning icon until the first guys page loads completely, then the second persons page will start to load.
Does that indicate anything. That can't be right.
I have no problems with concurrent access on my own written apps against the same database. Could I have done something wrong with the driver compilation or something?
Larry Menard
Joined: 2005-10-01
Posts: 757
Posted: Tue, 2006-06-06 02:45
I posted your Monitor results to a DB2 newsgroup, and eventually I got a response that they think the ratio of rows read to rows selected (88:1) seemed high. They suspect the Optimizer is selecting a bad access plan for at least some statements. I'm still discussing it with them, will let you know more details as soon as I know them. You did do RUNSTATS on all tables, right? Can you provide the output of a "runstats current statistics on schema ..." command?
Your latest symptom doesn't sound (to me) like a bad access plan though. That sounds like locking or perhaps serializing connections. Could you please reproduce this scenario, and while the 2nd connection is hanging, connect a CLP session to the database and run the command "db2 list applications show detail".
And I'd really like to know if it makes any difference if Gallery uses its own database. I don't suppose I could convince you to try that, could I? ;-)
I doubt this has anything to do with your building of the ibm_db2 driver... it just boils down to CLI calls, and all the CLI packages should already be properly bound to the database.
73blazer
Joined: 2006-05-12
Posts: 79
Posted: Tue, 2006-06-06 03:49
I can supply anything you want!
Yes I did runstats, after the major importing was complete.
Did you mean reorgchk or runstats current statistics. There isn't a "current statistics" clause for runstats, only reorgchk. I provided that, as I assume that's what you were looking for. If not..., as stated earlier, I can provide anything!
Also is the output of the list applications with show detail.
I could easily make a new database, what is it though that your curious about. This database isn't loaded at all, it's just my personal database at the moment for testing here, and it's pretty much just me and my family connecting for various applications. Usally there's no connections at all.
But I can give it try tommorow.
> I could easily make a new database, what is it though that your curious about
I'm just trying to eliminate differences between your setup and mine and sphericus'.
Larry Menard
Joined: 2005-10-01
Posts: 757
Posted: Sat, 2006-06-10 20:26
73Blazer,
> Concurrent users
The fact that both applications are in status "UOW Waiting" indicates that there are transactions in process, but the database is not currently servicing any statements. It might be waiting on some external action to complete (web server, php, Gallery application code, operating system, ...). I'm not sure what we can do about this. Let's focus on the single-user performance and hope it also helps this.
> Single-user: Poor performance loading pages
The DB2 Performance folks have asked me for a CLI Trace. They can then run the trace through a parser and determine where time is being spent in CLI.
To keep the trace as simple as possible, please trace only 1 action that demonstrates the poor performance. And please make sure the database is ACTIVATEd before taking the trace.
Command to enable a CLI trace:
db2 update cli cfg for section common using trace 1 tracepathname some_existing_directory traceflush 1 tracecomm 1 tracetimestamp 1
Command to disable a CLI trace:
db2 update cli cfg for section common using trace '' tracepathname '' traceflush '' tracecomm '' tracetimestamp ''
Then you should have a CLI trace file in the directory you specified. Please post a link to that and I'll take it from there.
1) Please provide a dump of the CLI, DB and DBM CONFIGURATIONs and "db2set -all" output
db2 get cli cfg > cfg.cli
db2 connect to WWWDB
db2 get db cfg for wwwdb show detail > cfg.db
db2 connect reset
db2 get dbm cfg show detail > cfg.dbm
db2set -all > cfg.db2set
2) Is there anything informative in your instance's 'db2diag.log' file?
If necessary, the next step might be a db2trc. I hope it doesn't come to that.
73blazer
Joined: 2006-05-12
Posts: 79
Posted: Mon, 2006-06-12 12:09
I tried just quickly here to do the clitrace. I turn it on, success, I pick a g2 page that takes 18seconds to load, I stop the trace. I don't get anything in the diractory specified. It's created and owned and 777 permissions by instance owner.
I must have done something wrong...I'll try it again later today when I have more time. I thought clitrace was when there was a db2 error? Is it supposed to trace any client executions?
Thank you very much for your help, I'll get it a little later today!
Larry Menard
Joined: 2005-10-01
Posts: 757
Posted: Mon, 2006-06-12 13:56
CLI Trace traces the client-side calls through the CLI interface (IBM's version of ODBC). By analyzing the times in this trace we can see:
1) What statements are taking unusually long
2) What API is taking long (Prepare, Bind, Execute, Fetch, etc.).
It's possible that you might have to close all existing connections to the db in order for CLI Trace to work. Even a db2stop/db2start if possible. (Remember to ACTIVATE the database after db2start.)
DB2trace is for tracing server-side functionality. I really hope it doesn't come to that.
Please remember to try creating and using a separate Gallery2 database when you get a chance.
73blazer
Joined: 2006-05-12
Posts: 79
Posted: Thu, 2006-06-15 02:33
Ok, sorry. I got swamped at work and I'm out of town. But I got some time tonight, and remotely peformed all the tests.
I created a new database in a new instance and copied the table contents over via import/export.
I got the same performance. Slow page loads.
I made four different and seperate traces. first one loads main alubum page, other are loading various other sub-album pages with 40 thumbs each.
I don't see anything abnormal in the diaglog. Just the normal looking stuff I see in the same things in the ones at work.
Again, thanks a bunch for the help.
Larry Menard
Joined: 2005-10-01
Posts: 757
Posted: Thu, 2006-06-15 15:59
Hey, no apology necessary. I know how life is.
Thanks for the info.
At least now I know there's no difference between shared and exclusive databases.
I'll take a look at the CLI traces and get back to you.
Thanks again.
Larry Menard
Joined: 2005-10-01
Posts: 757
Posted: Thu, 2006-06-15 17:17
Could you check your "get dbm cfg" output? For some reason it seems to think you don't have an Instance attachment.
Also, the CLI traces look, well, pretty much empty. All they have in them is environment initialization and stmt handle allocation stuff. There should be loads of other entries, for example:
Just thought I would check if you needed anymore data for the tests I tried to complete, or if anyone had any ideas or recommendations for me, with respect to the unit tests that I had submitted.
As right now I have a lot of time to help, so I just wanted to make sure that you guys weren't waiting on anything from me.
All the best with everything, I know you guys are quite busy with the mssql support as well. Unfortunatly I have no experience with mssql, so I am completely useless for that.
I'm afraid I don't know anything about proxys, either reverse or otherwise. Valiant, any suggestions?
bharat
Joined: 2002-05-21
Posts: 7994
Posted: Sat, 2006-06-24 18:10
Hm. Can you run just that test? (use a filter of EmbedTest.testCheckActiveUser). When just that test is failing, try editing GallerySession.class and on line 591 add this:
This will dump out a stack trace from the failure which we can use to figure out the path that the code took to get to this failure.
sphericus
Joined: 2005-11-06
Posts: 55
Posted: Sun, 2006-06-25 05:43
That test is not failing.
Just curious however, what did that test, test for?
Incase you were wondering, my reverse proxy send the client ip address in a "Client-IP:" header in the http packet, right after a "Via:" header.
The reverse proxy is only making the ip mismatch tests fail though. As when I go direct the mismatch errors disappear, but the other error still remain.
Edit: Just re ran the unit tests, and now I know roughly what is going on again. Did you want the debug on line 591 even tho it ran sucessfully by itself?
sphericus
Joined: 2005-11-06
Posts: 55
Posted: Sun, 2006-06-25 05:47
Some additional info.
If I run the unit tests with EmbedTest as the filter, they all complete successfully.
Larry Menard
Joined: 2005-10-01
Posts: 757
Posted: Sun, 2006-06-25 14:04
I think Bharat's reason for specifying that test is that the test immediately before that one is the last successful one.
If all the "EmbedTest" filter tests run clean, then something in some previous test failure might be causing it to fail (I know there are other cases of that).
It could be helpful to trim down your repro scenario to the simplest possible case. I'd recommend you run with a filter that consists only of all your failed tests plus EmbedTest.testCheckActiveUser:
If EmbedTest.testCheckActiveUser still doesn't run successfully, remove one of the previous tests from the filter and repeat the process until it runs clean. At that point, the last one you removed from the filter could be causing the problem in EmbedTest.testCheckActiveUser. Then try running it with only those 2 tests to see if you can repro the problem using only those 2 tests. That's your minimal repro scenario.
sphericus
Joined: 2005-11-06
Posts: 55
Posted: Sun, 2006-06-25 16:03
will do
sphericus
Joined: 2005-11-06
Posts: 55
Posted: Sun, 2006-06-25 22:59
OK.
All the imports (testImportno_NO, testImportfr_FR, testImportKOI_8) continue to fail.
However, the test of "testImportKOI_8" is interferring with the "EmbedTest.testCheckActiveUser" as well as "ConfirmImportControllerTest.testConvertHtmlToBbcode".
Once "testImportKOI_8" was removed from the test run, both "EmbedTest.testCheckActiveUser" and "ConfirmImportControllerTest.testConvertHtmlToBbcode" sucessfully complete.
It gets pretty far then stops.
Will post output for you
Hope this helps.
Larry Menard
Joined: 2005-10-01
Posts: 757
Posted: Mon, 2006-06-26 03:53
> All the imports (testImportno_NO, testImportfr_FR, testImportKOI_8) continue to fail
I expect that. I believe there's a G2 defect open for it... something about determining the number of bytes in multibyte strings. Should use mb_strlen(), or something like that. Don't worry about these for the time being.
> Once "testImportKOI_8" was removed from the test run, both "EmbedTest.testCheckActiveUser" and "ConfirmImportControllerTest.testConvertHtmlToBbcode" sucessfully complete
I don't know about "EmbedTest.testCheckActiveUser", but I also see the same thing with "ConfirmImportControllerTest.testConvertHtmlToBbcode" on Windows. Again, I wouldn't worry about this right now.
> It gets pretty far then stops.
I also see this on Windows, and also with SQL Server, so it's not specifically a DB2 thing. In fact, when I run the whole suite of unit tests it usually has to be done in 3 or 4 'chunks'. In fact, I'm doing so right now with my MSSQL porting work. It's a pain in the ass for sure, but there's always more urgent things to work on.
> Will post output for you
Yes, I'd like to see it.
Thanks, Sphericus.
bharat
Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2006-06-27 04:09
I've seen the "it gets pretty far then stops" problem in the past. Generally it's an issue with PHP up and crashing. The complete unit test run stresses PHP pretty heavily, as you might imagine. Check your error logs to see if you're getting PHP seg faulting, and make sure you're running the latest version of PHP4 (or PHP5).
Larry Menard
Joined: 2005-10-01
Posts: 757
Posted: Tue, 2006-06-27 19:15
> "it gets pretty far then stops" problem
I usually am within one point-release of latest PHP code. My php.ini doesn't change the log settings, so errors should be written to the Event Log. But there's nothing in my Application or System event logs that looks related to PHP.
I typically also have a Remote Desktop client session running on my test system, but I'm currently running unit tests while NOT running a RD client, and it seems MUCH more stable. I'm sure RD is a memory hog, perhaps that's the problem.
73blazer
Joined: 2006-05-12
Posts: 79
Posted: Wed, 2006-08-02 20:52
Hmmm.. If I add show detail that's what it says. A quick google told me I needed to do a db2 attach $DB2INSTANCE and then run it, then detach. I've never heard of the attach command before. That file has been updated. Sorry about that.
I've run the clitrace thing many times, that's the most I can get to show up in there. Dunno....that's all I get. Something else I'm doing wrong?
Check out http://www.snyderworld.org/ftp/clitraces/connection_evmon.txt
It's a connection event monitor. Look at the timestamp between 3 and 4. THere's my delay, but still can't seem to pinpoint anything wrong.
I've run statments event monitor, I can add up all the exec times in that to 1.8seconds, so execution is ok. I've run deadlocks evmon, shows 0, i've run transactions and bufferpools, and everything looks good. .......... grrr.......
Larry Menard
Joined: 2005-10-01
Posts: 757
Posted: Sat, 2006-08-05 23:08
Hmmm indeed. If you can't take CLI traces, then I begin to suspect you are not actually using the CLI-based "ibm_db2" driver, but are still using PHP's ODBC.
In your original posting you stated your environment included "IBM_DB2 and ibm-db2". Any chance you could lose the "ibm-db2" ODBC support and see if that helps?
Larry Menard
Joined: 2005-10-01
Posts: 757
Posted: Sat, 2006-08-05 23:19
You could also verify that your native DB2 CLI is performing well... try building & running some of the CLI sample applications... "sqllib/samples/cli/*".
73blazer
Joined: 2006-05-12
Posts: 79
Posted: Mon, 2006-08-07 13:29
CLI is definitly performing well. I have a application I wrote from scratch using the CLI conncetions (started with some of the samples in samples/cli), that app runs perfectly, super fast. ANd I see traces in my clitrace directory from it, because I left them on.
Anyhow, I left it on for a while, and low and behold, when I looked the next day the filesystem I had sent traces to was full, from gallery ( I grep g2 from the large files and it's all g2 related stuff). Since those weren't controlled traces, I cleared them (like an idiot, well I wanted /tmp free again), and hit a couple of gallery pages, and nothing again. Restarted db2, apache. Still nothing. Something with the way I'm starting them, they aren't showing up right away...I just need to read up more on these clitraces I guess...
Later today hopefully I can have some decent traces....
Larry Menard
Joined: 2005-10-01
Posts: 757
Posted: Mon, 2006-08-07 17:34
You can add traceflush=1 to your cli.ini to force the trace to spool immediately
73blazer
Joined: 2006-05-12
Posts: 79
Posted: Sat, 2006-09-09 14:45
FYI
I just upgraded my g2 from 2.1.1 to 2.1.2
I used the patch file for 2.1.1 to 2.1.2, unzipped and ran the web-upgrader.
I encountered the following problems:
The database upgrade part didn't put the schema infront of any tables or function names, and it was attempting to install functions that already existed. FOr a lack of understanding the G2 code, I simply cased out what I knew was the problem with this:
In file lib/adodb/drivers/adodb-db2.inc.php
changed line 532 from
Quote:
$stmtid = db2_exec($this->_connectionID,$sql);
to
Quote:
$sql=str_replace("g2_User","g2.g2_User",$sql);
$sql=str_replace("g2_PluginParameterMap","g2.g2_PluginParameterMap",$sql);
$sql=str_replace("g2_Entity","g2.g2_Entity",$sql);
$sql=str_replace("g2_PluginMap","g2.g2_PluginMap",$sql);
echo "KEN: [$sql]";
if (substr_count($sql,"SQLJ.INSTALL_JAR") == 0 &&
substr_count($sql,"CREATE FUNCTION BIT_AND")==0 &&
substr_count($sql,"CREATE FUNCTION G2_LIKE")==0 &&
substr_count($sql,"CREATE FUNCTION G2_BIT_OR")==0 &&
substr_count($sql,"CREATE FUNCTION G2_BIT_AND")==0
) {
echo "KEN3: NOT JAR OR FUNCTION";
$stmtid = db2_exec($this->_connectionID,$sql);
} else {
echo "KEN2 Sorry, this done manually";
}
Other than that it ran good and seems to be all working ok. Still have the performance issue...but I'll get back to that shortly here....
73blazer
Joined: 2006-05-12
Posts: 79
Posted: Sun, 2006-09-10 03:18
So there's a bit of an issue with the RAND function, at least the way g2 is using it with DB2.
G2 uses it in the order clause when the random image block is called (to display a random image)
In DB2, if RAND() not seeded, it returns the same value the fist time for each connect (session).
I noticed it using the random image block, the image was the same, and being there was no posts about it, I figured it must be my AIX or DB2.
Easy fix, in modules/core/classes/GalleryStorage/Db2Storage.class (under case 'RAND')I changed line 240 (g2 version 2.1.2) from
$sql = sprintf('RAND(%s)', empty($args) ? '' : $args[0]);
to
$sql = sprintf('RAND(%s)', empty($args) ? mt_rand(0,2147483647) : $args[0]);
Now my random image changes every time I re-load the page or call the external random image block function.
If there's something better, which there probably is, be my guest. This is fast and works for me.
And where does that get submitted to so it gets integrated into the next release of g2?
Ken
73blazer
Joined: 2006-05-12
Posts: 79
Posted: Sun, 2006-09-10 03:53
I submitted a bug report. Hopefully that was the right course of action. Please feel free to scold me if it wasn't.
RAND() report looks good, thanks.
not sure about the upgrade problem.. I see that postgres has some sql in configureStore and it ignores errors in case it's bit_or function is already installed.. doesn't look like the Db2 code ignores errors. that would explain problems with "CALL", but not the other sql with G2 table names and no prefixes. there wasn't any sql in the 2.1.2 upgrade other than updating the core version number, so not sure what those queries were.
Larry Menard
Joined: 2005-10-01
Posts: 757
Posted: Sun, 2006-09-10 21:44
Yes, thanks for reporting the RAND() problem. I only recently started using Image Block, and I had noticed that it was somewhat less than truly random. It did change every time I reloaded pages, but I had noticed that it was reusing the same images with surprising frequency.
Line 532 of my 2.1.2 "lib/adodb/drivers/adodb-db2.inc.php" isn't what you quoted.
$stmtid = db2_exec($this->_connectionID,$sql); // <- Is this the db2_exec() you mean?
$this->_lastAffectedRows = 0;
if ($stmtid) {
if (@db2_num_fields($stmtid) == 0) {
$this->_lastAffectedRows = db2_num_rows($stmtid);
$stmtid = true;
} else {
$this->_lastAffectedRows = 0;
}
if ($this->_haserrorfunctions) { // <- This is line 532
In the upgrade path, it should run cleanStore() which should drop the 4 G2 UDFs and uninstall the Jar file before reinstalling/recreating them. Did you happen to notice any error in the DROP FUNCTION or CALL SQLJ.REMOVE_JAR()?
Re the performance problem, I really suspect your ibm_db2 extension. You say that your native DB2 CLI and your other apps perform well, so I suspect DB2 itself is healthy. Your other apps probably aren't using the ibm_db2 extension, so... what happens if you run a simple home-grown PHP app that uses the ibm_db2 extension? I'll attach a sample script here. Edit the dbname, userid, and password in it, then run it twice, once to use ibm_db2 and once to use ODBC:
C:\MyServer>php ibm_db2_test.php ibm_db2
API in use = 'db2'.
Processing statement "DROP TABLE mytable"...
Statement execution succesful.
Processing statement "CREATE TABLE mytable (col1 char(1))"...
Statement execution succesful.
Processing statement "INSERT INTO mytable VALUES ('1')"...
Statement execution succesful.
Processing statement "INSERT INTO mytable VALUES ('2')"...
Statement execution succesful.
Processing statement "INSERT INTO mytable VALUES (NULL)"...
Statement execution succesful.
Processing statement "INSERT INTO mytable VALUES ('4')"...
Statement execution succesful.
Processing statement "SELECT col1 FROM mytable"...
Statement execution succesful.
1
2
4
C:\MyServer>php ibm_db2_test.php odbc
API in use = 'odbc'.
Processing statement "DROP TABLE mytable"...
Statement execution succesful.
Processing statement "CREATE TABLE mytable (col1 char(1))"...
Statement execution succesful.
Processing statement "INSERT INTO mytable VALUES ('1')"...
Statement execution succesful.
Processing statement "INSERT INTO mytable VALUES ('2')"...
Statement execution succesful.
Processing statement "INSERT INTO mytable VALUES (NULL)"...
Statement execution succesful.
Processing statement "INSERT INTO mytable VALUES ('4')"...
Statement execution succesful.
Processing statement "SELECT col1 FROM mytable"...
Statement execution succesful.
1
2
4
C:\MyServer>
Does it perform equally well in both cases? (Maybe modify the SQL that it calls... make it as complex as you want.) If not, then the problem is something with your ibm_db2 driver... perhaps the way it was built.
73blazer
Joined: 2006-05-12
Posts: 79
Posted: Mon, 2006-09-11 00:02
I didn't notice any errors for DROP or REMOVE CALL. I wasn't really paying attention though. I admit I kinda upgraded with a casual attitude, forgetting that I was using a database and wasn't paying much attention. I was in a bit of a hurray too, so I just buzzed through it as quick as I could. I'll see if I can find any log files laying around anywhere.
I added a large SQL return. (Well, somewhat large, more than 4 )
I added a simple php timer. Time page took to execute is printed at bottom. Just tkeep re-loading, then change API and reload a few mote times.THe times are pretty consistent.
FOr your simple creates and inserts and select, they were pretty much the same.
WHen I added my longer SQL in there, the ibm_db2 beats out odbc by 0.2 seconds! BUt nothing took longer than 0.7 seconds to perform.
The little php blogger I'm working on I'm using db2_connect, it's working ok.
BTW, know any good php DB2 backed blog software? I don't think I want to code all the features I want.
Larry Menard
Joined: 2005-10-01
Posts: 757
Posted: Mon, 2006-09-11 00:29
Well, I'm glad to see the ibm_db2 out-performs ODBC (at least in this test), but your G2 performance problem is really puzzling me.
Were you ever able to get those complete CLI traces? I don't know how helpful they will be, but they're worth a try because the folks at IBM asked for them.
73blazer
Joined: 2006-05-12
Posts: 79
Posted: Mon, 2006-09-11 03:05
Man, I really don't know what I'm doing wrong. All I can get is the connects from db2adm. Originally, I though my problem was, I forgot this is a client trace, I was trying to actiave from db2adm (instance owner) and thus I only saw a couple of connects.
I put in user nobody, user root, user db232cli (32bit db2 instance client that accesses the 64 bit db2 instance, so apache can talk to it). I can't get anything to populate there for the trace file? I tried the activate explcitly in apachectl, I tried to export the DB2CLIINIPATH to a valid r/w by all db2cli.ini file. Nothing. What the heck am I doing wrong? I don't get it? I've spent the last 2 1/2 hours trying to generate traces. Event monitor works, is that useful?
73blazer
Joined: 2006-05-12
Posts: 79
Posted: Mon, 2006-09-11 03:24
Whew. Ok I stepped away for a few minutes and grabbed a beer.
I started from scratch, and I think I finally got it!
THe two big files poped in there when I loaded a page that took about 12 seconds to load.
Thanks for the help!
Ken
73blazer
Joined: 2006-05-12
Posts: 79
Posted: Mon, 2006-09-11 03:48
Here's another set, going from 1 page to the next inside an album with 891 items (each page displays 40 thumbnails (set to 100 size in album properties)
Only 1 operation in here, pick next to go to the next page and I stopped the trace. (~22 seconds to load this page with the trace on)
These might be better, I was sure the database was activated here, I can't remember if I did that the first time or not I was playing with so many things. Usally it is though.
Now that I know how to do it (I needed to use the export DB2CLIINIPATH for user running apachectl and the db2cli.ini file needed to have a blank line at the end!) I can make them if you happen to need different ones.
THanks again.
Ken
Larry Menard
Joined: 2005-10-01
Posts: 757
Posted: Mon, 2006-09-11 12:51
Now those are what I call CLI traces.
I'll run them through the parser the IBM folks sent me, and discuss the results with them, and get back to you.
Larry Menard
Joined: 2005-10-01
Posts: 757
Posted: Mon, 2006-09-11 12:54
BTW, I sent your question about DB2-backed blog software to a few people (including Dan Scott), and so far have gotten one response (from Dan):
Quote:
I had started work on a fairly major patch for Serendipity
(http://s9y.org) back in the spring to add DB2 support, but didn't
finish that work off
(http://sourceforge.net/mailarchive/forum.php?thread_id=9555380&forum_id=31275).
The patch is still up at http://coffeecode.net/s9y/ibm_db2.diff should
anyone be interested in finishing off what I started -- obviously a
bit of work would be required just to sync up the changes to the s9y
source since then. IIRC, the major challenges are the usual: the
assumption that you can pass a string variable into an integer column
and the database will automatically typecast it into an integer for
you, and the fairly extensive use of LIMIT/OFFSET. My patch took care
of most of the DML issues (assumptions about non-standard data types)
and some of the typecasting & LIMIT issues.
Serendipity is distributed under the BSD license, which is a good
thing for any IBMer interested in working on it or eventually
redistributing it. No GPL contamination issues. And if you want to see
what it looks like, I'm running http://coffeecode.net on Serendipity
(albeit with a MySQL backend).
Posts: 32509
yes, that's the one. but obviously you first have to run the installer to install a "standard type" (read: not multisite) installation. else you cannot run the test framework.
i'm off now. good luck and thanks for testing!
Posts: 55
Will doing a standard type install break an existing multisite install? As I have done the multisite one already and created a few sites. Will doing a standard install damage the other ones at all?
Sorry if the questions are a bit silly.
Posts: 757
Unfortunately I don't know jack about multi-site. Somebody else will need to answer that.
Thanks for your sanity testing. If you don't mind me asking, what tool did you use to emulate that 200 users? That sounds handy.
Posts: 55
I used this tool, its not too bad, I normally have it generate a script based on what I do in IE. Then it plays it as many times as I want, and as fast as it can.
http://www.microsoft.com/downloads/details.aspx?FamilyID=e2c0585a-062a-439e-a67d-75a89aa36495&DisplayLang=en
Also, forgot to mention that this Tool, combined with Page Detailer, I find quite useful.
Posts: 32509
no, i standard installation won't break multisites, as long as you choose another database / storage folder for each and every installation.
Posts: 55
Thanks,
I am trying to get all the modules up and working, will let you know once they are all up and I have the response from the unit test.
Quick question, is mod_rewrite supposed to be hard to get up? It seems to be not playing nicely with the apache module.
Posts: 55
Actually I just realized I had to type "all" into the filter table to run the tests.
Please find the test results attached.
There are a few modules which are not installed, like ImageMagick, which I have not installed, as I could not find RPM's for SLES9 for them.
Posts: 757
I find the URL rewrite config page not very self-explanatory. URL rewrite can use either the Apache module or PHP's support (you only need one of them to work). I don't even try the Apache module anymore; the PHP support works for me.
Posts: 32509
sphericus,
you only ran 165 unit tests. we have 2200+ unittests.
you filtered the tests by the string "all" which explains it.
delete "all" and just hit enter in the empty filter input field.
Posts: 55
Try this one, it died at test 484, with this in the apache error log
Now the IP addy mismatches are probably due to the reverse proxy, and g2 not exactly seeing eye-to-eye.
I ran the test twice, with the same result
Posts: 55
I also just ran one direct to the box, it got rid of the ip addy issues, but the other ones have not changed.
Posts: 55
Also just noticed this.
Now I have about 4000 lines of that in my error log. Don't know if it is significant
Posts: 79
Here's another symtom of my severe performance problem.um
If more than one person is viewing the gallery, let's say I click to load an album one one computer, and my wife in the other room clicks to load a different alubum on another computer, whoever clicked first, gets to look at their page first, then second persons gets a spinning icon until the first guys page loads completely, then the second persons page will start to load.
Does that indicate anything. That can't be right.
I have no problems with concurrent access on my own written apps against the same database. Could I have done something wrong with the driver compilation or something?
Posts: 757
I posted your Monitor results to a DB2 newsgroup, and eventually I got a response that they think the ratio of rows read to rows selected (88:1) seemed high. They suspect the Optimizer is selecting a bad access plan for at least some statements. I'm still discussing it with them, will let you know more details as soon as I know them. You did do RUNSTATS on all tables, right? Can you provide the output of a "runstats current statistics on schema ..." command?
Your latest symptom doesn't sound (to me) like a bad access plan though. That sounds like locking or perhaps serializing connections. Could you please reproduce this scenario, and while the 2nd connection is hanging, connect a CLP session to the database and run the command "db2 list applications show detail".
And I'd really like to know if it makes any difference if Gallery uses its own database. I don't suppose I could convince you to try that, could I? ;-)
I doubt this has anything to do with your building of the ibm_db2 driver... it just boils down to CLI calls, and all the CLI packages should already be properly bound to the database.
Posts: 79
I can supply anything you want!
Yes I did runstats, after the major importing was complete.
Did you mean reorgchk or runstats current statistics. There isn't a "current statistics" clause for runstats, only reorgchk. I provided that, as I assume that's what you were looking for. If not..., as stated earlier, I can provide anything!
Also is the output of the list applications with show detail.
I could easily make a new database, what is it though that your curious about. This database isn't loaded at all, it's just my personal database at the moment for testing here, and it's pretty much just me and my family connecting for various applications. Usally there's no connections at all.
But I can give it try tommorow.
http://www.snyderworld.org/ftp/reorg_currentstats.txt
http://www.snyderworld.org/ftp/listapps.txt
Thanks for your help!
Posts: 757
> I could easily make a new database, what is it though that your curious about
I'm just trying to eliminate differences between your setup and mine and sphericus'.
Posts: 757
73Blazer,
> Concurrent users
The fact that both applications are in status "UOW Waiting" indicates that there are transactions in process, but the database is not currently servicing any statements. It might be waiting on some external action to complete (web server, php, Gallery application code, operating system, ...). I'm not sure what we can do about this. Let's focus on the single-user performance and hope it also helps this.
> Single-user: Poor performance loading pages
The DB2 Performance folks have asked me for a CLI Trace. They can then run the trace through a parser and determine where time is being spent in CLI.
To keep the trace as simple as possible, please trace only 1 action that demonstrates the poor performance. And please make sure the database is ACTIVATEd before taking the trace.
Command to enable a CLI trace:
db2 update cli cfg for section common using trace 1 tracepathname some_existing_directory traceflush 1 tracecomm 1 tracetimestamp 1
Command to disable a CLI trace:
Then you should have a CLI trace file in the directory you specified. Please post a link to that and I'll take it from there.
For more info on CLI traces: http://publib.boulder.ibm.com/infocenter/db2luw/v8/topic/com.ibm.db2.udb.pd.doc/pd/c0020795.htm.
> Also...
1) Please provide a dump of the CLI, DB and DBM CONFIGURATIONs and "db2set -all" output
2) Is there anything informative in your instance's 'db2diag.log' file?
If necessary, the next step might be a db2trc. I hope it doesn't come to that.
Posts: 79
I tried just quickly here to do the clitrace. I turn it on, success, I pick a g2 page that takes 18seconds to load, I stop the trace. I don't get anything in the diractory specified. It's created and owned and 777 permissions by instance owner.
I must have done something wrong...I'll try it again later today when I have more time. I thought clitrace was when there was a db2 error? Is it supposed to trace any client executions?
Thank you very much for your help, I'll get it a little later today!
Posts: 757
CLI Trace traces the client-side calls through the CLI interface (IBM's version of ODBC). By analyzing the times in this trace we can see:
1) What statements are taking unusually long
2) What API is taking long (Prepare, Bind, Execute, Fetch, etc.).
It's possible that you might have to close all existing connections to the db in order for CLI Trace to work. Even a db2stop/db2start if possible. (Remember to ACTIVATE the database after db2start.)
DB2trace is for tracing server-side functionality. I really hope it doesn't come to that.
Please remember to try creating and using a separate Gallery2 database when you get a chance.
Posts: 79
Ok, sorry. I got swamped at work and I'm out of town. But I got some time tonight, and remotely peformed all the tests.
I created a new database in a new instance and copied the table contents over via import/export.
I got the same performance. Slow page loads.
I had to stop and start then activate the trace to get it to put the trace file.
Everything is in: http://www.snyderworld.org/ftp/clitraces
I made four different and seperate traces. first one loads main alubum page, other are loading various other sub-album pages with 40 thumbs each.
I don't see anything abnormal in the diaglog. Just the normal looking stuff I see in the same things in the ones at work.
Again, thanks a bunch for the help.
Posts: 757
Hey, no apology necessary. I know how life is.
Thanks for the info.
At least now I know there's no difference between shared and exclusive databases.
I'll take a look at the CLI traces and get back to you.
Thanks again.
Posts: 757
Could you check your "get dbm cfg" output? For some reason it seems to think you don't have an Instance attachment.
Also, the CLI traces look, well, pretty much empty. All they have in them is environment initialization and stmt handle allocation stuff. There should be loads of other entries, for example:
http://cpe0013102da23b-cm0f0079804905.cpe.net.cable.rogers.com/misc/gallery2/p2524t816.cli
Posts: 55
Just thought I would check if you needed anymore data for the tests I tried to complete, or if anyone had any ideas or recommendations for me, with respect to the unit tests that I had submitted.
As right now I have a lot of time to help, so I just wanted to make sure that you guys weren't waiting on anything from me.
All the best with everything, I know you guys are quite busy with the mssql support as well. Unfortunatly I have no experience with mssql, so I am completely useless for that.
Posts: 757
Hi Sphericus.
Sorry, I guess we lost track of your unit test problem (http://gallery.menalto.com/node/37648?page=18#comment-186644)
I'm afraid I don't know anything about proxys, either reverse or otherwise. Valiant, any suggestions?
Posts: 7994
Hm. Can you run just that test? (use a filter of EmbedTest.testCheckActiveUser). When just that test is failing, try editing GallerySession.class and on line 591 add this:
print "<pre>"; print_r(debug_backtrace()); print "</pre>";
This will dump out a stack trace from the failure which we can use to figure out the path that the code took to get to this failure.
Posts: 55
That test is not failing.
Just curious however, what did that test, test for?
Incase you were wondering, my reverse proxy send the client ip address in a "Client-IP:" header in the http packet, right after a "Via:" header.
The reverse proxy is only making the ip mismatch tests fail though. As when I go direct the mismatch errors disappear, but the other error still remain.
Edit: Just re ran the unit tests, and now I know roughly what is going on again. Did you want the debug on line 591 even tho it ran sucessfully by itself?
Posts: 55
Some additional info.
If I run the unit tests with EmbedTest as the filter, they all complete successfully.
Posts: 757
I think Bharat's reason for specifying that test is that the test immediately before that one is the last successful one.
If all the "EmbedTest" filter tests run clean, then something in some previous test failure might be causing it to fail (I know there are other cases of that).
It could be helpful to trim down your repro scenario to the simplest possible case. I'd recommend you run with a filter that consists only of all your failed tests plus EmbedTest.testCheckActiveUser:
If EmbedTest.testCheckActiveUser still doesn't run successfully, remove one of the previous tests from the filter and repeat the process until it runs clean. At that point, the last one you removed from the filter could be causing the problem in EmbedTest.testCheckActiveUser. Then try running it with only those 2 tests to see if you can repro the problem using only those 2 tests. That's your minimal repro scenario.
Posts: 55
will do
Posts: 55
OK.
All the imports (testImportno_NO, testImportfr_FR, testImportKOI_8) continue to fail.
However, the test of "testImportKOI_8" is interferring with the "EmbedTest.testCheckActiveUser" as well as "ConfirmImportControllerTest.testConvertHtmlToBbcode".
Once "testImportKOI_8" was removed from the test run, both "EmbedTest.testCheckActiveUser" and "ConfirmImportControllerTest.testConvertHtmlToBbcode" sucessfully complete.
It gets pretty far then stops.
Will post output for you
Hope this helps.
Posts: 757
> All the imports (testImportno_NO, testImportfr_FR, testImportKOI_8) continue to fail
I expect that. I believe there's a G2 defect open for it... something about determining the number of bytes in multibyte strings. Should use mb_strlen(), or something like that. Don't worry about these for the time being.
> Once "testImportKOI_8" was removed from the test run, both "EmbedTest.testCheckActiveUser" and "ConfirmImportControllerTest.testConvertHtmlToBbcode" sucessfully complete
I don't know about "EmbedTest.testCheckActiveUser", but I also see the same thing with "ConfirmImportControllerTest.testConvertHtmlToBbcode" on Windows. Again, I wouldn't worry about this right now.
> It gets pretty far then stops.
I also see this on Windows, and also with SQL Server, so it's not specifically a DB2 thing. In fact, when I run the whole suite of unit tests it usually has to be done in 3 or 4 'chunks'. In fact, I'm doing so right now with my MSSQL porting work. It's a pain in the ass for sure, but there's always more urgent things to work on.
> Will post output for you
Yes, I'd like to see it.
Thanks, Sphericus.
Posts: 7994
I've seen the "it gets pretty far then stops" problem in the past. Generally it's an issue with PHP up and crashing. The complete unit test run stresses PHP pretty heavily, as you might imagine. Check your error logs to see if you're getting PHP seg faulting, and make sure you're running the latest version of PHP4 (or PHP5).
Posts: 757
> "it gets pretty far then stops" problem
I usually am within one point-release of latest PHP code. My php.ini doesn't change the log settings, so errors should be written to the Event Log. But there's nothing in my Application or System event logs that looks related to PHP.
I typically also have a Remote Desktop client session running on my test system, but I'm currently running unit tests while NOT running a RD client, and it seems MUCH more stable. I'm sure RD is a memory hog, perhaps that's the problem.
Posts: 79
Hmmm.. If I add show detail that's what it says. A quick google told me I needed to do a db2 attach $DB2INSTANCE and then run it, then detach. I've never heard of the attach command before. That file has been updated. Sorry about that.
I've run the clitrace thing many times, that's the most I can get to show up in there. Dunno....that's all I get. Something else I'm doing wrong?
Check out http://www.snyderworld.org/ftp/clitraces/connection_evmon.txt
It's a connection event monitor. Look at the timestamp between 3 and 4. THere's my delay, but still can't seem to pinpoint anything wrong.
I've run statments event monitor, I can add up all the exec times in that to 1.8seconds, so execution is ok. I've run deadlocks evmon, shows 0, i've run transactions and bufferpools, and everything looks good. .......... grrr.......
Posts: 757
Hmmm indeed. If you can't take CLI traces, then I begin to suspect you are not actually using the CLI-based "ibm_db2" driver, but are still using PHP's ODBC.
In your original posting you stated your environment included "IBM_DB2 and ibm-db2". Any chance you could lose the "ibm-db2" ODBC support and see if that helps?
Posts: 757
You could also verify that your native DB2 CLI is performing well... try building & running some of the CLI sample applications... "sqllib/samples/cli/*".
Posts: 79
CLI is definitly performing well. I have a application I wrote from scratch using the CLI conncetions (started with some of the samples in samples/cli), that app runs perfectly, super fast. ANd I see traces in my clitrace directory from it, because I left them on.
Anyhow, I left it on for a while, and low and behold, when I looked the next day the filesystem I had sent traces to was full, from gallery ( I grep g2 from the large files and it's all g2 related stuff). Since those weren't controlled traces, I cleared them (like an idiot, well I wanted /tmp free again), and hit a couple of gallery pages, and nothing again. Restarted db2, apache. Still nothing. Something with the way I'm starting them, they aren't showing up right away...I just need to read up more on these clitraces I guess...
Later today hopefully I can have some decent traces....
Posts: 757
You can add traceflush=1 to your cli.ini to force the trace to spool immediately
Posts: 79
FYI
I just upgraded my g2 from 2.1.1 to 2.1.2
I used the patch file for 2.1.1 to 2.1.2, unzipped and ran the web-upgrader.
I encountered the following problems:
The database upgrade part didn't put the schema infront of any tables or function names, and it was attempting to install functions that already existed. FOr a lack of understanding the G2 code, I simply cased out what I knew was the problem with this:
In file lib/adodb/drivers/adodb-db2.inc.php
changed line 532 from
to
Other than that it ran good and seems to be all working ok. Still have the performance issue...but I'll get back to that shortly here....
Posts: 79
So there's a bit of an issue with the RAND function, at least the way g2 is using it with DB2.
G2 uses it in the order clause when the random image block is called (to display a random image)
In DB2, if RAND() not seeded, it returns the same value the fist time for each connect (session).
I noticed it using the random image block, the image was the same, and being there was no posts about it, I figured it must be my AIX or DB2.
Easy fix, in modules/core/classes/GalleryStorage/Db2Storage.class (under case 'RAND')I changed line 240 (g2 version 2.1.2) from
$sql = sprintf('RAND(%s)', empty($args) ? '' : $args[0]);
to
$sql = sprintf('RAND(%s)', empty($args) ? mt_rand(0,2147483647) : $args[0]);
Now my random image changes every time I re-load the page or call the external random image block function.
If there's something better, which there probably is, be my guest. This is fast and works for me.
And where does that get submitted to so it gets integrated into the next release of g2?
Ken
Posts: 79
I submitted a bug report. Hopefully that was the right course of action. Please feel free to scold me if it wasn't.
http://sourceforge.net/tracker/index.php?func=detail&aid=1555626&group_id=7130&atid=107130
Posts: 8601
RAND() report looks good, thanks.
not sure about the upgrade problem.. I see that postgres has some sql in configureStore and it ignores errors in case it's bit_or function is already installed.. doesn't look like the Db2 code ignores errors. that would explain problems with "CALL", but not the other sql with G2 table names and no prefixes. there wasn't any sql in the 2.1.2 upgrade other than updating the core version number, so not sure what those queries were.
Posts: 757
Yes, thanks for reporting the RAND() problem. I only recently started using Image Block, and I had noticed that it was somewhat less than truly random. It did change every time I reloaded pages, but I had noticed that it was reusing the same images with surprising frequency.
Line 532 of my 2.1.2 "lib/adodb/drivers/adodb-db2.inc.php" isn't what you quoted.
In the upgrade path, it should run cleanStore() which should drop the 4 G2 UDFs and uninstall the Jar file before reinstalling/recreating them. Did you happen to notice any error in the DROP FUNCTION or CALL SQLJ.REMOVE_JAR()?
Re the performance problem, I really suspect your ibm_db2 extension. You say that your native DB2 CLI and your other apps perform well, so I suspect DB2 itself is healthy. Your other apps probably aren't using the ibm_db2 extension, so... what happens if you run a simple home-grown PHP app that uses the ibm_db2 extension? I'll attach a sample script here. Edit the dbname, userid, and password in it, then run it twice, once to use ibm_db2 and once to use ODBC:
Does it perform equally well in both cases? (Maybe modify the SQL that it calls... make it as complex as you want.) If not, then the problem is something with your ibm_db2 driver... perhaps the way it was built.
Posts: 79
I didn't notice any errors for DROP or REMOVE CALL. I wasn't really paying attention though. I admit I kinda upgraded with a casual attitude, forgetting that I was using a database and wasn't paying much attention. I was in a bit of a hurray too, so I just buzzed through it as quick as I could. I'll see if I can find any log files laying around anywhere.
Ok, so I tried your script. I didn't install the command line php stuff, so I ran it in a web server (try for yourself http://snyderworld.org/test/index.php?api=ibm_db2 or http://snyderworld.org/test/index.php?api=odbc)
I added a large SQL return. (Well, somewhat large, more than 4 )
I added a simple php timer. Time page took to execute is printed at bottom. Just tkeep re-loading, then change API and reload a few mote times.THe times are pretty consistent.
FOr your simple creates and inserts and select, they were pretty much the same.
WHen I added my longer SQL in there, the ibm_db2 beats out odbc by 0.2 seconds! BUt nothing took longer than 0.7 seconds to perform.
The little php blogger I'm working on I'm using db2_connect, it's working ok.
BTW, know any good php DB2 backed blog software? I don't think I want to code all the features I want.
Posts: 757
Well, I'm glad to see the ibm_db2 out-performs ODBC (at least in this test), but your G2 performance problem is really puzzling me.
Were you ever able to get those complete CLI traces? I don't know how helpful they will be, but they're worth a try because the folks at IBM asked for them.
Posts: 79
Man, I really don't know what I'm doing wrong. All I can get is the connects from db2adm. Originally, I though my problem was, I forgot this is a client trace, I was trying to actiave from db2adm (instance owner) and thus I only saw a couple of connects.
I put in user nobody, user root, user db232cli (32bit db2 instance client that accesses the 64 bit db2 instance, so apache can talk to it). I can't get anything to populate there for the trace file? I tried the activate explcitly in apachectl, I tried to export the DB2CLIINIPATH to a valid r/w by all db2cli.ini file. Nothing. What the heck am I doing wrong? I don't get it? I've spent the last 2 1/2 hours trying to generate traces. Event monitor works, is that useful?
Posts: 79
Whew. Ok I stepped away for a few minutes and grabbed a beer.
I started from scratch, and I think I finally got it!
Try these:
http://www.snyderworld.org/ftp/clitrace
THe two big files poped in there when I loaded a page that took about 12 seconds to load.
Thanks for the help!
Ken
Posts: 79
Here's another set, going from 1 page to the next inside an album with 891 items (each page displays 40 thumbnails (set to 100 size in album properties)
http://www.snyderworld.org/ftp/clitrace3
Only 1 operation in here, pick next to go to the next page and I stopped the trace. (~22 seconds to load this page with the trace on)
These might be better, I was sure the database was activated here, I can't remember if I did that the first time or not I was playing with so many things. Usally it is though.
Now that I know how to do it (I needed to use the export DB2CLIINIPATH for user running apachectl and the db2cli.ini file needed to have a blank line at the end!) I can make them if you happen to need different ones.
THanks again.
Ken
Posts: 757
Now those are what I call CLI traces.
I'll run them through the parser the IBM folks sent me, and discuss the results with them, and get back to you.
Posts: 757
BTW, I sent your question about DB2-backed blog software to a few people (including Dan Scott), and so far have gotten one response (from Dan):
I'll let you know if anyone else responds.