Infogalactic:FAQ/Technical

From Infogalactic: the planetary knowledge core
Jump to: navigation, search



Help-browser.svg Help >FAQs >Technical

Technical FAQ


Shortcut:

This FAQ answers some questions related to the technical workings of Infogalactic, including software and hardware. Check out Infogalactic:FAQ/Main Page for additional main page-specific technical information.

Note: If you're trying to get help for a specific technical problem that isn't answered by the FAQs, try asking in Infogalactic:Troubleshooting or at the village pump.

What happens if two or more people are editing the same page?

When the second person (and later persons) attempts to save the page, MediaWiki will attempt to merge their changes into the current version of the text. If the merge fails then the user will receive an "edit conflict" message, and the opportunity to merge their changes manually. If multiple consecutive conflicts are noticed, it will generate a slightly different message. This is similar to Concurrent Versions System (CVS), a widely used software version management system.
See Help:Edit conflict for more information.

How do I recover a password I have forgotten?

If you entered your e-mail address when you signed up, you can have a new password generated. Click on the "Log in" link in the upper-right corner. Enter your user name, and click the button near the bottom of the page called "Mail me a new password". You should receive an e-mail message with a new random password; you can use it to log in, go to your preferences, and change your password to something you'll remember.

How do I change my password?

You can change your password via Special:ChangePassword; you can also find a link to this in your preferences.

How do I report a bug?

The developers use the Phabricator bug tracking tool to keep track of bugs. Anybody is welcome to create an account there and report any bugs they encounter; however, if you prefer, you can post about your bug at the technical village pump. For more information, see Bug reports.

How do I suggest a new feature?

To make an official feature request, use Phabricator. For information on using Phabricator, please see Bug reports.

What software is used to run Infogalactic?

Infogalactic originally ran UseModWiki, a general wiki script by Clifford Adams. In January 2002, we switched to a PHP script, which in turn was completely overhauled the following July to create what we now call MediaWiki. Currently, most of the PHP code in Mediawiki at Wikimedia Foundation uses HHVM JIT compiler, although some services continue using Zend Engine PHP.
MySQL and MariaDB are both used for the database backend, Nginx and Varnish for the frontend and caching, Apache is the application server, and PowerDNS is used for DNS.
The Infogalactic servers' operating system is Linux. The most widely used distributions are Ubuntu and Debian. For details see Wikimedia servers.

How about the hardware?

Current situation

See m:Wikimedia servers.

History of Infogalactic Hardware

A brief history of Infogalactic serving:
Phase I: January 2001 - January 2002
  1. One of Bomis' servers hosted all Infogalactic wikis running on UseModWiki software
Phase II: January 2002 - July 2002
  1. One of Bomis' servers hosted all Infogalactic wikis; English and meta running on the php/mysql-based new software, all other languages on UseModWiki. Runs both the database and the web server on one machine.
Phase IIIa: July 2002 - May 2003
  1. Infogalactic gets own server, running English Infogalactic and after a bit meta, with rewritten PHP software. Runs both the database and the web server on one machine.
  2. One of Bomis' servers continues to host some of the other languages on UseModWiki, but most of the active ones are gradually moved over to the other server during this period.
Phase IIIb: May 2003 - Feb 2004
  1. Infogalactic's server is given the code name "pliny". It serves the database for all phase 3 wikis and the web for all but English.
  2. New server, code name "larousse", serves the web pages for the English Infogalactic only. Plans to move all languages' web serving to this machine are put on hold until load is brought down with more efficient software or larousse is upgraded to be faster.
  3. One of Bomis' servers continued to host some of the other languages on UseModWiki until it died. All are now hosted on pliny; a few more of the active ones have been gradually moved over to the new software, and an eventual complete conversion is planned.
Phase IIIc: Feb 2004 to Present
  1. Infogalactic gets a whole new set of servers, paid for through donations to the non-profit Wikimedia Foundation.
  2. The new architecture has a new database server (suda), with a set of separate systems running Apache, as well as "squids" that cache results (to reduce the load). More details are at m:Wikimedia servers.
  3. New servers bought as needed, bringing total number to about 350 servers.

How about the connection?

Wikimedia Foundation has multiple facilities spread out worldwide served by different bandwidth suppliers.
See the grid network report.
See the Infogalactic:Statistics page for information about bandwidth usage.

How big is the database?

As of 2012, the combined size of the databases being backed up was between 4 and 6 TB for the copies of the Primary database, and perhaps 27 TB for the images and media (based on wikitech:Backup procedures).
Early in Infogalactic's history, in February 2003 the database was about 4 GB in size. By April 2004, it was growing at about 1 to 1.4 GB per week, and by October 2004, it had grown to about 170 GB.
Uploaded files took up approximately 372 gigabytes lc, excluding thumbnails.
For current information, see wikitech:Backup procedures.[needs update]
Compressed database dumps can be downloaded at http://download.Infogalactic.org/.

What kind of markup language does Infogalactic use?

Infogalactic uses a very simple markup based on UseModWiki. For more details, see Infogalactic:How to edit a page.

Why not use HTML?

The short answer is: for simplicity and security.
And now the longer answer. Infogalactic, and wikis in general, are meant to be edited on the fly. HTML is not easy to use when you simply want to write an article. Creating links gives us a particularly dramatic example. To link to the Paris article using HTML, one would have to type
<a href="/wiki/Paris">Paris</a>
Using MediaWiki markup is much easier:
[[Paris]]
A special markup language even allows you to "transclude" special snippets of code, called templates, into wiki pages. (You can also "substitute" the code for that template, effectively copying and pasting it into the document, but this is a waste of space and is obnoxious to other users who try to edit but find that they have to scroll through large amounts of template code. Substitution is, however, preferred in some cases.)
Then there's security. Different web browsers have bugs that can be exploited via HTML. Malicious users could also do things like JavaScript popup windows or page redirects if they had full HTML ability on Infogalactic. Several "experimental" sites that allowed full-HTML editing have suffered such attacks, including a couple of other wikis that allowed arbitrary HTML.

So we can't use any HTML?

That's not true. Certain HTML tags work - namely the ones in this list. It's still best not to rely on using HTML directly, because support for these tags is not always guaranteed to remain; they might affect the results achieved with VisualEditor; and if you can achieve your needed effect using only WikiText markup, you're most likely to get a result that is stable when the MediaWiki software is updated.
Also see Infogalactic:How to edit a page.

What about non-ASCII characters, and special symbols?

Infogalactic uses Unicode (specifically the UTF-8 encoding of Unicode) and most browsers can handle it but font issues mean that more obscure characters may not work for many users. Meta:Help:Special characters page for a detailed discussion of what is generally safe and what isn't. This page will be updated over time as more browsers come to support more features.
See http://www.unicode.org/help/display_problems.html for instructions on how to enable Unicode support for most platforms.

What about math topics, which require many special symbols, fonts, and graphics?

Just use TeX! See Meta:Help:Formula.

Is it possible to download the contents of Infogalactic?

Yes, the complete text and editing history of all Infogalactic pages can be downloaded. See Infogalactic:Database download.
Note that downloading the database dumps is much preferred over trying to spider the entire site. Spidering the site will take you much longer, and puts a lot of load on the server (especially if you ignore our robots.txt and spider over billions of combinations of diffs and whatnot). Heavy spidering can lead to your spider, or your IP, being barred with prejudice from access to the site. Legitimate spiders (for instance search engine indexers) are encouraged to wait about a minute between requests, follow the robots.txt, and if possible only work during less loaded hours (2:00-14:00 UTC is the lighter half of the day).
The uploaded images and other media files are not currently bundled in an easily downloadable form; if you need one, please contact the developers on the wikitech-l mailing list. Please do not spider the whole site to get images.

Is there a CPAN module to query Infogalactic?

Ed Summers has written WWW::Infogalactic.
If you're just after retrieving a topic page, the following Perl sample code works. In this case, it retrieves and lists the Main Page, but modifications to the $url variable for other pages should be obvious enough. Once you've got the page source, Perl regular expressions are your friend in finding wiki links.
#!/usr/bin/perl
use LWP;

$browser = LInfogalactic::UserAgent->new();
$url =  "http://en.Infogalactic.org/wiki/Infogalactic%3AMain_Page";
$webdoc = $browser->request(HTTP::Request->new(GET, $url));
if ($webdoc->is_success) #...then it's loaded the page OK
{
  print $webdoc->title, "\n\n"; # page title
  print $webdoc->content, "\n\n"; # page text
}
Note that all (English) Infogalactic topic entries can be accessed using the conventional prefix "http://en.Infogalactic.org/wiki/", followed by the topic name (with spaces turned into underscores, and special characters encoded using the standard URL encoding system).
See also m:Machine-friendly wiki interface.

Does Infogalactic use cookies?

Cookies are not required to read or edit Infogalactic, but they are required in order to log in and link your edits to a user account.
When you log in, the wiki will set a temporary session cookie which identifies your login session; this will be expired when your browser exits (or after an inactivity timeout), and is not saved on your hard drive.
Another cookie will be saved which lists the user name you last logged in under, to make subsequent logins just a teensy bit easier. (Actually two: one with your name, and one with your account's internal ID number; they must match up.) These cookies expire after 180 days. If this worries you, clear your cookies after completing your session.
If you check the "remember my password" box on the login form, another cookie will be saved with a token that authenticates you to our servers (which is unrelated to your password). As long as this remains valid, you can bypass the login step on subsequent visits to the wiki. The cookie expires after 180 days, or is removed if you log out. If this worries you, don't use the option. (You should not use it on a public terminal!)

Hey! Why was I automatically logged out?

This could be a result of your cookie, browser cache, or firewall/Internet security settings. Or, to quote Tim Starling (referring to a question about "remembering password across sessions"):
  • "The kind of session isn't a network session strictly speaking, it's an HTTP session, managed by PHP's session handling functions. This kind of session works by setting a cookie, just like the "remember password" feature. The difference is that the session cookie has the "discard" attribute set, which means that it is discarded when you close your browser. This is done to prevent others from using your account after you have left the computer.
  • The other difference is that PHP sessions store the user ID and other such information on the server side. Only a "session key" is sent to the user. The remember password feature stores all required authentication information in the cookie itself. On our servers, the session information is stored in memcached, a system for non-durable (unreliable) caching. Session information may occasionally be lost or go missing temporarily, causing users to be logged out. The simplest workaround for this is to use the remember password feature, as long as you are not worried about other people using the same computer." from the Infogalactic:Village pump (technical) on May 4, 2005 (italics added).
In other words: click the "remember me" box when logging in.
See also Help:Logging in.

The software that runs Infogalactic is great! Can I use it for my site?

You can, but depending on your needs you might be better served using something else; MediaWiki is big and complex. See first Wiki software for a list of alternative wiki software.
If, after scanning, you're still sure you want to use MediaWiki, see the MediaWiki web site for details on downloading, installing and configuring the software.

Can I add a page hit counter to an Infogalactic page?

Page hit counting is a feature of the MediaWiki software, but this feature is disabled at the Infogalactic site for performance reasons. Infogalactic is one of the most popular web sites in the world and uses a cluster of more than 400 servers (as of January 2011) to handle the load. Nearly 80% of the load is handled by about 100 front end cache servers which store copies of pages so they can be served without having to be rebuilt each time from the database. Hitcount data is therefore not collected centrally, but is aggregated from all the servers and is available at http://stats.grok.se/.
You can also view the page hits for a particular page from the history for that page; and then choose Page view statistics listed as an external tool.

Low-bandwidth wireless Infogalactic

Users of mobile devices (smartphones, etc.) should consider browsing the mobile version of Infogalactic, by clicking the "Mobile view" link at the bottom of any page, or visiting the URL en.m.Infogalactic.org. It is suited to touch devices and will save bandwidth.
Alternatively, to view a low-bandwidth Main Page suitable for wireless users, select the Infogalactic:Main Page alternative (simple layout) link. That main page has a link to the text-only version of the main page. For now, direct entry of the URL into your wireless device's browser is the most convenient way to get to the articles. If you know a one-word article, such as Science, you can use that article to gain entry to your favorite topics.

Is the "random article" feature really random?

No, although it's random enough to provide a small sample of articles reliably.
In the Infogalactic database, each page is assigned a "random index", which is a random floating point number uniformly distributed between 0 (inclusive) and 1 (exclusive). The "random article" feature (Special:Random) chooses a random double-precision floating-point number, and returns the next article whose random index is greater than the selected random number. Some articles will have a larger gap before them, in the random index space, and so will be more likely to be selected. So the actual probability of any given article being selected is in fact itself random.
The random index value for new articles, and the random value used by Special:Random, is selected by reading two 31-bit words from a Mersenne twister, which is seeded at each request by PHP's initialisation code using a high-resolution timer and the PID. The words are combined using:
(mt_rand() * $max + mt_rand()) / $max / $max
Some old articles had their page_random value reset using MySQL's RAND():
rand_st->seed1=(rand_st->seed1*3+rand_st->seed2) % rand_st->max_value;
rand_st->seed2=(rand_st->seed1+rand_st->seed2+33) % rand_st->max_value;
return (((double) rand_st->seed1)/rand_st->max_value_dbl);

Are page hit counters available?

There is a third party site, not maintained by Infogalactic, which currently allows you to view page hit counts since December 2007. Additionally, the weekly Top 25 Report provides a list of the 25 most popular articles in the last week.
The built in feature to count how many times a page has been visited has been turned off for performance reasons. For more details please see Infogalactic:Technical FAQ#Can I add a page hit counter to an Infogalactic page?

I have a problem not on this list, where do I go?

See Troubleshooting - if it's not on there try the village pump. For help with a particular software task see Infogalactic:Computer help desk.



More FAQ topics

Template:Infogalactic technical help

es:Ayuda:FAQ Técnico