You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org

User:Jamesday/notes

From Wikitech-static
Jump to navigation Jump to search

Profiling for complete beginners:

vim CommonSettings.php  main configuration file for MediaWiki loaded via NFS on every script invocation
/Profiling
i or a to enter insert/append mode
uncomment the profiling code
in php, you can comment using #   //    or /* */ blocks

open up a second PuTTY window and connect to suda via zwinger (log in to zwinger and type "ssh suda"
type "sql" to open the mysql client
truncate table profiling;

in the vim window, save your file by switching to normal mode then typing ":w"

select * from profiling

you can see how many times each function has been called, and how long in total calls to each function have taken

exit the mysql client, and type at your command prompt: "sql enwiki -vvv < ~tstarling/sql/profiling.sql"
-vvv means very very verbose

cat ~tstarling/sql/profiling.sql




Convenient commands

echo "show processlist" | sql | grep enwiki | grep -v Locked
echo "show processlist" | sql | grep temporary

Account settings

/etc/profile PATH=$PATH:/home/wikipedia/bin ~/.bashrc cdp Tim's cd /home/wikipedia/common/php-new "cdp i" for cd /home/wikipedia/common/php-new/includes, m for maintenance and l for language

Assorted notes

Tim uses vim, brion joe


/home/wikipedia/common/php-new/maintenance]$ vim james_tmp.sh

  1. !/bin/bash

cd /home/wikipedia/common/php-new/maintenance PHP=/usr/local/bin/php

       $PHP updateSearchIndex.php simple wikipedia -s 20001125044702 -p maintenance/searchpos/simple.wikipedia
       $PHP updateSearchIndex.php foundation wikipedia -s 20001125044702 -p maintenance/searchpos/foundation.wikipedia
       $PHP updateSearchIndex.php species wikipedia -s 20001125044702 -p maintenance/searchpos/species.wikipedia
       $PHP updateSearchIndex.php mediawiki mediawiki -s 20001125044702 -p maintenance/searchpos/mediawiki.wikipedia

for x in `</home/wikipedia/common/langlist` ;do

       echo -----------------------------------------------------------
       echo $x.wikibooks.org
       echo -----------------------------------------------------------
       echo
       $PHP updateSearchIndex.php $x wikibooks -s 20001125044702 -p maintenance/searchpos/$x.wikibooks

done

for x in `</home/wikipedia/common/langlist` ;do

       echo -----------------------------------------------------------
       echo $x.wikiquote.org
       echo -----------------------------------------------------------
       echo
       $PHP updateSearchIndex.php $x wikiquote -s 20001125044702 -p maintenance/searchpos/$x.wikiquote

done

for x in `</home/wikipedia/common/langlist` ;do

       echo -----------------------------------------------------------
       echo $x.wikisource.org
       echo -----------------------------------------------------------
       echo
       $PHP updateSearchIndex.php $x wikisource -s 20001125044702 -p maintenance/searchpos/$x.wikisource

done

/home/wikipedia/common/special.dblist /home/wikipedia/common/php-new/maintenance]$ cat updateSearchIndex.sh

select count(*), count(distinct(left4_md5_ns_title)) as l4, count(distinct(left5_md5_ns_title)) as l5, count(distinct(left6_md5_ns_title)) as l6, count(distinct(left7_md5_ns_title)) as l7, count(distinct(left8_md5_ns_title)) as l8 from jamesday_old_md5;

create table jamesday_old_md5 engine=MyISAM select old_id, md5_ns_title, left(md5_ns_title,4) as left4_md5_ns_title, left(md5_ns_title,5) as left5_md5_ns_title, left(md5_ns_title,6) as left6_md5_ns_title, left(md5_ns_title,7) as left7_md5_ns_title,left(md5_ns_title,8) as left8_md5_ns_title,left(md5_ns_title,9) as left9_md5_ns_title,left(md5_ns_title,10) as left10_md5_ns_title,left(md5_ns_title,11) as left11_md5_ns_title,left(md5_ns_title,12) as left12_md5_ns_title,left(md5_ns_title,13) as left13_md5_ns_title,left(md5_ns_title,14) as left14_md5_ns_title,left(md5_ns_title,15) as left15_md5_ns_title,left(md5_ns_title,16) as left16_md5_ns_title from jamesday_old_summary;


select count(*), count(distinct(md5_ns_title)) as md5,count(distinct(left4_md5_ns_title)) as l4, count(distinct(left5_md5_ns_title)) as l5, count(distinct(left6_md5_ns_title)) as l6, count(distinct(left7_md5_ns_title)) as l7, count(distinct(left8_md5_ns_title)) as l8, count(distinct(left9_md5_ns_title)) as l9, count(distinct(left10_md5_ns_title)) as l10, count(distinct(left11_md5_ns_title)) as l11, count(distinct(left12_md5_ns_title)) as l12, count(distinct(left13_md5_ns_title)) as l13, count(distinct(left14_md5_ns_title)) as l14, count(distinct(left15_md5_ns_title)) as l15, count(distinct(left16_md5_ns_title)) as l16 from jamesday_old_md5;


Kenh

dual backplane

dual opteron 2U dual channnel raid megaraid 2X 2 int 2 ext on 2 channels

dual opteron sata 6 drives

3 12 drive JBOD with 10 ish drives