posts tagged ‘wordpress’.

wordpress dos-ing itself, and optimization.

march 1st, 2009 at 7:20 +0000 by felix.

while updating some old posts with photos (just designwise, no content changed), i once again experienced a complete lockdown: the server became incredible slow and was floaded with apache processes, and i had to shut down and kill -9 all apache processes several times to be able to continue to do anything except waiting. this isn’t the first time this happend, but this time i had apache’s logging enabled (waiting for something like this) to see what was causing all the accesses. well, out of the 13.000 logfile entries (ranging over a week, i think), around 3.300 were by wordpress – and 99.9% of these happend in the last few hours, while i was updating the old posts. it seems that every time i updated a post, wordpress accesses all links and images in the post, also the local ones, and downloads them. yes, downloads them – also the big versions of panoramas. and if i’m updating posts with often 10–30 photos, some of them large, this clearly explains why the web server was dying. to put it that way, wordpress dosed itself. (the funny thing is that it did not first use a head first, to see what kind of link this is, but starts with a get to first download the whole thing. after downloading all links and images, it uses head on them.)
anyway. i don’t know at the moment what to do against that.
but another annoying thing is that the blog is loading rather slow. i also decided to see what is causing this. well, it turns out that the old main page was doing 298 sql queries. after disabling role scoper, this jumped down to 34, with loading times more or less the same. but then, i disabled the tag cloud. this just saved one query, but reduced the page generation time from around 10 to 2 seconds. wow. enabling role scoper again (i really need that one), i now have a bit less than 50 queries with maybe 4-5 seconds of page creation time.
well, still far from optimal, but already faster.

wordpress and latex.

february 28th, 2009 at 22:58 +0000 by felix.

i was thinking on using latex in maybe some blog entries, maybe here or maybe somewhere else. so i decided to see what existing plugins there are. after a bit of searching, i stumbled over wp-latex, which is apparently also used by wordpress.com. unfortunately, it has a kind of clumsy syntax (“$latex formula$” instead of simply “$formula$”). and it has no support for display style formulae, i.e. something centered in its own line, as opposed to inline formulae which try to fit neatly into the text.
so i tried to fix that. and it worked out, and i can still use a “normal” $ by appending a blackslash in front of it. well, euler’s identity is e^{i \pi} + 1 = 0, as simple as that. if you want to see something more complicated:

let K be a number field or an algebraic function field. then, we have the following commutative diagram with exact rows and columns:
\displaystyle \xymatrix{ & 0 \ar[d] & 0 \ar[d] & 0 \ar[d] & \\ 0 \ar[r] & \calO^* / k^* \ar[r] \ar[d] & \Div^0_\infty(K) \ar[r] \ar[d] & T \ar[r] \ar[d] & 0 \\ 0 \ar[r] & K^* / k^* \ar[r] \ar[d] & \Div^0(K) \ar[r] \ar[d] & \Pic^0(K) \ar[r] \ar[d] & 0 \\ 0 \ar[r] & K^* / \calO^* \ar[r] \ar[d] & \Id(\calO) \ar[r] \ar[d] & \Pic(\calO) \ar[r] \ar[d] & 0 \\ & 0 & H \ar@{=}[r] \ar[d] & H \ar[d] & \\ & & 0 & 0 & }
here, T simply denotes the cokernel of the map \calO^* \to \Div^0_\infty(K) which assigns to every unit \varepsilon \in \calO^* its principal divisor (\varepsilon); in particular, T \cong \Div^0_\infty(K) / (\Princ(K) \cap \Div^0_\infty(K)). finally, H denotes the cokernel of the degree map \Div(K) \to \G, where in the number field case, \G = \R, and in the function field case, \G = \Z.

this is written as follows:

let $K$ be a number field or an algebraic function field. then, we have the following commutative diagram with exact rows and columns:
$$\xymatrix{ & 0 \ar[d] & 0 \ar[d] & 0 \ar[d] & \\ 0 \ar[r] & \calO^* / k^* \ar[r] \ar[d] & \Div^0_\infty(K) \ar[r] \ar[d] & T \ar[r] \ar[d] & 0 \\ 0 \ar[r] & K^* / k^* \ar[r] \ar[d] & \Div^0(K) \ar[r] \ar[d] & \Pic^0(K) \ar[r] \ar[d] & 0 \\ 0 \ar[r] & K^* / \calO^* \ar[r] \ar[d] & \Id(\calO) \ar[r] \ar[d] & \Pic(\calO) \ar[r] \ar[d] & 0 \\ & 0 & H \ar@{=}[r] \ar[d] & H \ar[d] & \\ & & 0 & 0 & }$$
here, $T$ simply denotes the cokernel of the map $\calO^* \to \Div^0_\infty(K)$ which assigns to every unit $\varepsilon \in \calO^*$ its principal divisor $(\varepsilon)$; in particular, $T \cong \Div^0_\infty(K) / (\Princ(K) \cap \Div^0_\infty(K))$. finally, $H$ denotes the cokernel of the degree map $\Div(K) \to \G$, where in the number field case, $\G = \R$, and in the function field case, $\G = \Z$.

note that this example also shows a problem: namely, the vertical alignment of the inline formulae sucks bigtime. let’s see how to fix this…

new wordpress.

february 15th, 2009 at 4:54 +0000 by felix.

there was a new version of wordpress out, so i (finally) upgraded. the layout of the admin area completely changed; i already heard about that before. i don’t know if it’s better or worse than the old one, but i stumbled over one thing which is really annoying: in case you write private articles (like me) to ensure that in case the role scoper plugin stops working (or is simply disabled due to upgrades), nobody can see the private stuff (instead of everyone), you will find out that the new version of wordpress automatically publishes articles as soon as the visibility is set to private! this is pretty annoying, as i usually do that as one of the first things before writing (most of) the post itself.
another thing which got worse is the size of the tags field (for the simple tags plugin), which now resides in the right (narrow) column. before, it was prominently seated directly below the area where the post content itself is written (which is rather wide). as i often use a long list of tags, this makes things more confusing than they have to be.

moving.

november 20th, 2008 at 0:09 +0000 by felix.

spielwiese moved to a new server today. it’s way faster now, as you might have already noticed. unfortunately, the ad rotator plugin which i used to display the random lyrics stopped working, probably it doesn’t like the php version running here. maybe i’ll replace it at some point…

clean-up.

october 30th, 2008 at 21:52 +0000 by felix.

today i cleaned up my blog a bit – at least on the technical side. i wrote a plug-in which encapsulates all my changes to wordpress, so the underlying wordpress is now a standard installation, making upgrading way easier.
moreover, as you might have noticed, i added a login box to the right margin. after playing around in the last days a bit, it seems that my goals can be partially resolved using role scoper. well, not perfectly, but at least to some extend. (so there’s still the need to write the optimal blog software.)

finally, …

february 24th, 2008 at 21:11 +0000 by felix.

… my blog really has 100% valid xhtml 1.0 transitional code.

valid xhtml 1.0 transitional

until now, there were some exceptions:

  • a wordpress bug which generated invalid xhtml code if you have more than one blogroll category (which will be fixed in the next version; i wrote a quick hack to fix the one i’m using);
  • the youtube code snippet was quite a mess, i fixed it using some hints from the w3c validator page and by some tipps by kornel, as wordpress tended to screw up my code by inserting tags and, thus, rendering it invalid; i fixed that by using installing a plugin which allows to format specific posts completely yourself;
  • certain small bugs in my posts which were completely my faults (these will probably show up from time to time, but i’m trying to eliminate them asap).

maybe i’ll once try to force wordpress to generate xhtml 1.0 strict code, but that’s probably too much work; probably i can hack something together myself in less time which fits better to my needs and which generates such code :)