View Single Post
Old 2008-02-24, 11:47   #3
em99010pepe's Avatar
Sep 2004

2·5·283 Posts
Default How to set up a LLRnet server

The LLRnet server files can be downloaded from here:

windows version
linux version

The first thing to do is to change settings on llr-serverconfig.txt file, see bold text.

serverName - IP address of your machine

port = 100 - port, don't forget to open it on your firewall settings, UDP and TCP ports, open everything

maxConnections = 30 - max connections the server can handle simultaneously

jobMaxTime = 4 * 24 * 3600 -- 4 days - wu's will expire in x seconds

prunePeriod = 0.5 * 24 * 3600 -- 1/2 days - prunes the knpairs and the joblist txt files each X seconds

--displayFormat = "%s*2^%s+1" -- use this for PRP type test - for Proth numbers
displayFormat = "%s*2^%s-1" -- use this for LLR type test (default) - For Riesel numbers

serviceName = "NPLB_LLRserver" - if you run more than one server you should name them different

Below you'll find my llr-serverconfig.txt file content:

-- LLRNet - network part of LLR
-- (C) 2004-2005 Vincent Penne
-- (See file LICENSE that must be included with this software)
-- WARNING: comments start with two dashes

-- general settings

-- server name
-- used in particular to identify the server into the sql stats table
-- (change this name if you have several servers using the same sql database)
serverName = ""

-- port that the server listen to (make sure clients are configured
-- with the same number)
port = 100

-- maximum number of concurrent connections
maxConnections = 30

-- maximum allowed time for a user to complete a job (in seconds)
jobMaxTime = 4 * 24 * 3600 -- 4 days

-- various files used by the server
knPairsFile = "knpairs.txt"
jobListFile = "joblist.txt"
resultsFile = "results.txt"

-- if you want the server to regularly prune your knpairs and joblist
-- files, then uncomment the following line and set the period of
-- pruning in second.
prunePeriod = 0.5 * 24 * 3600 -- 1/2 days

-- (for gurus only)
if WIN32 then
no_shell = 1

-- format used to display numbers in result file
-- (uncomment the appropriate line)
--displayFormat = "%s*2^%s+1" -- use this for PRP type test
displayFormat = "%s*2^%s-1" -- use this for LLR type test (default)

-- uncomment the following line to remove username check when
-- accepting a new result
noUserCheck = 1

-- you can customize the way the date is displayed
-- (in joblist.txt and results.txt)
--function DisplayDate()
-- return date("%d/%m/%Y\ %r")

-- PROXY settings
-- uncomment the following line to make this server a proxy server
--proxy = 1

-- address of the parent server
proxyMasterAddress = "localhost"
proxyMasterPort = 7000

-- name of this proxy (change 'nobody' to something else)
proxyName = "nobody"

-- size of the proxy cache
proxyCacheSize = 10

-- minimum number of results to send back to the main server
-- at a time
proxyTosendThreshold = 10

-- name of the tosend file of the proxy
tosendFile = "tosend-proxy.txt"


-- below is an example of callback to log all primes as they are
-- found into an additional file

--function OnPrime(t, k, n, job)
-- local fileprime = openfile("primes.txt", "a")
-- if fileprime then
-- write(fileprime, format("[%s]\n", job.resultdate))
-- write(fileprime, format(displayFormat.." is prime! Time : %d.0 sec.\n",
-- k, n,
-- Seconds() - job.seconds))
-- closefile(fileprime)
-- end

-- similarly, you can have another callback called OnResult,
-- beware that it takes one additional argument (the residue)

--function OnResult(t, k, n, residue, job)
-- insert whatever you want here

-- SQL settings (mySql only at the moment)

-- uncomment the line below to use SQL
--sqlUsed = 1

-- sql general configuration
sqlServer = "localhost"
--sqlServerPort = 4000
sqlDriver = "mysql"
sqlUser = "llrnet"
sqlPassword = "llrnet"
sqlDbName = "llrnet"

-- SQL user table
-- uncomment the line below and set the name of the table of users
--sqlUsersTable = "users"

-- name of the fields containing the username and the password
sqlUsernameEntry= "username"
sqlPasswordEntry= "password"

-- SQL pairs and results
-- uncomment the line below and set the name of the tables
--sqlPairsTable = "pairs"
sqlJobsTable = "jobs"
sqlResultsTable = "results"
sqlRejectedTable= "rejected"

-- SQL stats
-- uncomment the line below to allow llrnet server statistics and infos
-- to be regularly updated into the given sql table
--sqlStatsTable = "stats"

-- WIN32 specific settings
-- uncomment the line below to hide the tray icon on startup
--hideTrayIcon = 1

-- change this value if you want to run several client as services
serviceName = "NPLB_LLRserver"

-- under WIN32 platform, uncomment the following line to log stdout and stderr
-- to a file called "stdout.txt"
--logOutput = 1

--port = 7001
--proxy = 1
--knPairsFile = "knpairs-proxy.txt"
--jobListFile = "joblist-proxy.txt"
--proxyCacheSize = 10
--proxyName = "proxy1"

--sqlUsed = 1
--sqlUsersTable = "users"
Next step is to create the knpairs.txt file. This one is the main file of the server and it's equivalent to an input file for manual LLRing (where you have the candidates to test). I usually download the file from the reservation thread. For the first time you just need to rename it to knpairs.txt and move to the server folder. If you are already running the server you always need to stop the server if you want to update the knpairs.txt file, this is very important. Stop the server, open knpairs.txt with notepad and add the work at the end of the content of knpairs.txt.
After everything is set up you can run the server by clicking on llrserver.exe file. The client runs on system tray, you have a console if you want to check the behave of the client. Its output is something like this:

NPLB_LLRserver current status :
connection request from 829ea741:43522 (socket 168)
Proposing pair 911/286858 to gd_barnes
connection closed (socket 168)
connection request from 200a8c0:3251 (socket 956)
Proposing pair 923/286858 to Free-DC_em99010pepe
connection closed (socket 956)
connection request from 200a8c0:3252 (socket 584)
Proposing pair 945/286858 to Free-DC_em99010pepe
connection closed (socket 584)
connection request from 829ea741:43528 (socket 168)
Proposing pair 981/286858 to gd_barnes
connection closed (socket 168)
You can easily check the pair proposed and to whom.

The results received by all clients will be written in a file called results.txt with the following format (base 2):

[month/day/year time]
k*2^n+-1 is not prime. Res64: **** Time : *** sec.


[month/day/year time]
k*2^n+-1 is prime.
You can always move results.txt file from the server folder that the server will always create one, never do this for knpairs.txt.

Doubts? I know my English is poor...


Last fiddled with by em99010pepe on 2008-02-24 at 12:09
em99010pepe is offline   Reply With Quote