What's the expected backing data store for Plans on Rails? I'm trying to decide whether or not to purchase some reserved capacity with Amazon, and I'd rather not prepay for a MySQL server that will sit unused.
Alex Cohn--
You received this message because you are subscribed to the Google Groups "GrinnellPlans Development" group.
To post to this group, send email to grinnellplan...@googlegroups.com.
To unsubscribe from this group, send email to grinnellplans-deve...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/grinnellplans-development?hl=en.
[1] What does the slow query log look like? What are the top offenders?
[2] What is the latency for search, and for the average plans request?
[3] What causes the replication to break occasionally?
[4] So we have some read-traffic going to the slave?
[5] Are we using InnoDB? What is the size of our InnodbBufferPool, and what's our cache miss rate? What constraint are we hitting; CPU, Disk, Memory or contention?
--
You received this message because you are subscribed to the Google Groups "GrinnellPlans Development" group.
To post to this group, send email to grinnellplan...@googlegroups.com.
To unsubscribe from this group, send email to grinnellplans-deve...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/grinnellplans-development?hl=en.
That first bit is just due to Doctrine doing a poor job constructing a concise query. We could do a better job with a string substitution, probably - there's no rule that we need to use the ORM for everything -
The second bit is limited by the apparent fact that MySQL does not index square brackets - so MATCH... AGAINST is unsuitable for planlove searches. Alex mentions this in issue 233, but I'm still looking in the MySQL docs for the reason - Alex, can you cite it? Not indexing punctuation marks is a sensible default for most use cases, I guess, but maybe it can be overridden.
Here's another idea: just change to the MATCH... AGAINST syntax anyway. As in: when I search for my planlove, the database is queried for all plans containing my username, bracketed or not, taking advantage of the FULLTEXT index. There would be some false positives from wherever my name appears unbracketed, but the PHP code that generates the snippets would only pick up the bracketed ones. That would be a minuscule performance cost compared to the current brute-force approach, yeah?
On Fri, Jul 20, 2012 at 2:12 AM, Tom Baldwin <tbal...@uoregon.edu> wrote:That first bit is just due to Doctrine doing a poor job constructing a concise query. We could do a better job with a string substitution, probably - there's no rule that we need to use the ORM for everything -
Definitely. ORMs are great, but if it's getting in our way here, there's nothing wrong with writing a hand-crafted query for a very specific use case like this.
The second bit is limited by the apparent fact that MySQL does not index square brackets - so MATCH... AGAINST is unsuitable for planlove searches. Alex mentions this in issue 233, but I'm still looking in the MySQL docs for the reason - Alex, can you cite it? Not indexing punctuation marks is a sensible default for most use cases, I guess, but maybe it can be overridden.
Here's another idea: just change to the MATCH... AGAINST syntax anyway. As in: when I search for my planlove, the database is queried for all plans containing my username, bracketed or not, taking advantage of the FULLTEXT index. There would be some false positives from wherever my name appears unbracketed, but the PHP code that generates the snippets would only pick up the bracketed ones. That would be a minuscule performance cost compared to the current brute-force approach, yeah?
I think that sounds like an excellent idea.So everyone knows - FULLTEXT indexes are not only specific to MySQL, they're actually specific to MyISAM tables, and can be a gigantic pain in the ass. I definitely wouldn't choose to use them on a new project. But, since the PHP app is already pretty tightly coupled to MySQL (and AFAIK we're on MyISAM), this seems like a good cheap way to semi-optimize the problem. Having a fulltext index will marginally improve the quality and performance of non-quicklove search results as well, though there may not be enough traffic there to be a concern.
Alex's simple homegrown solution would work fine too. I say go with whichever is least effort.
Hey Alex,[1] Cool. This info should be very helpful.
[2] You will have to modify the format string of the access log in the Apache config.[2-1] This package will need to be installed and the format string will have to configured with all the cool information we are looking for. Duration is specified by %D, and the requested URL is specified by %U. There might be other golden nuggets in there. http://httpd.apache.org/docs/2.2/mod/mod_log_config.html[2-2] Then we'll need to do some simple aggregation using standard linux utilities. This will give us latencies on a per page level.
[3] Can't do much about natural disasters, can we? :)
[4] Cool. Thanks for clarifying.[5] I guess once we have some metrics in place, we can start the InnoDB vs MyISAM discussion for our use case. Speaking of MyISAM, a quick google search highlights is capability to do fulltext searches efficiently. Maybe this could help quicklove a little.
--
You received this message because you are subscribed to the Google Groups "GrinnellPlans Development" group.
To post to this group, send email to grinnellplan...@googlegroups.com.
To unsubscribe from this group, send email to grinnellplans-deve...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/grinnellplans-development?hl=en.
I. Metrics & Benchmarks (Alex)
[1] We should now aggregate the slow query log using mysqldumpslow. I'm interested in the average slow query times.
[2] Any word on the Apache access log aggregation?
[3] We need to benchmark MATCH...AGAINST. General steps:
[3-1] If the column containing the plan is not already a TEXT column, copy the plans table into a new table, change the column to be TEXT on the new table.
[3-2] Construct a MATCH...AGAINST to simulate a planlove query about ten times.
[3-3] If created new table in [3-1], drop the table.
>I hadn't known about the word limit. If that's true, then your poor-man's index doesn't seem so naive any more. In that case, I like the idea of using your index for planlove searches instead of the FULLTEXT index. Non-planlove searches could use it, I guess, but I wonder whether the non-planlove search volume is even worth that trouble right now.
> I looked in to using FULLTEXT indexes. It isn't a bad idea, but there are a couple huge limitations. First, anyone with a username below the fulltext index's ft_min_word_len limit (defaults to 4), would be completely unable to use quicklove. There are 51 two- and three-character username accounts.
> Second, as Ian pointed out, it's not portable, and I want to retain the flexibility to move to InnoDB tables. Regular, non-quicklove searches seem well-suited to fulltext indexes, though.Can't argue with that.
Aside... the docs you linked do mention changing what characters are 'word characters' - by providing a custom charset XML file. I assume you looked into this and found what the catch was (no access on production, maybe... or generally being a PITA... just guessin')