FAQ: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
Line 6: Line 6:


# Use odbedit to save current ODB
# Use odbedit to save current ODB
 
<pre>
odbedit
odbedit
save current_odb.odb
save current_odb.odb
 
</pre>
# Stop all the running MIDAS processes, including mlogger and mserver using the web
# Stop all the running MIDAS processes, including mlogger and mserver using the web
interface. Then stop mhttpd as well.
interface. Then stop mhttpd as well.
# Remove your old ODB (we will recreate it after modifying MIDAS, using the backup you just
# Remove your old ODB (we will recreate it after modifying MIDAS, using the backup you just
made).
made).
 
<pre>
mv .ODB.SHM .ODB.SHM.20161104
mv .ODB.SHM .ODB.SHM.20161104
rm /dev/shm/thomas_ODB_SHM
rm /dev/shm/thomas_ODB_SHM
 
</pre>
# Make the following modifications to midas.  In this particular case I have increased the
# Make the following modifications to midas.  In this particular case I have increased the
max number of open records from 256 to 1024.  You would need to change the constants if you
max number of open records from 256 to 1024.  You would need to change the constants if you
want to change to other values
want to change to other values
 
<pre>
diff --git a/include/midas.h b/include/midas.h
diff --git a/include/midas.h b/include/midas.h
index 02b30dd..33be7be 100644
index 02b30dd..33be7be 100644
Line 39: Line 38:
+  assert(sizeof(DATABASE_CLIENT) == 8256);
+  assert(sizeof(DATABASE_CLIENT) == 8256);
+  assert(sizeof(DATABASE_HEADER) == 528448);
+  assert(sizeof(DATABASE_HEADER) == 528448);
 
</pre>
The calculation is as follows (in case you want a different number of open records):  
The calculation is as follows (in case you want a different number of open records):  
DATABASE_CLIENT = 64 + 8*MAX_OPEN_ERCORDS = 64 + 8*1024 = 8256
DATABASE_CLIENT = 64 + 8*MAX_OPEN_ERCORDS = 64 + 8*1024 = 8256
DATABASE_HEADER = 64 + 64*DATABASE_CLIENT = 64 + 64*8256 = 528448
DATABASE_HEADER = 64 + 64*DATABASE_CLIENT = 64 + 64*8256 = 528448
 
# Rebuild MIDAS
5) Rebuild MIDAS
<pre>
 
make clean; make
make clean; make
 
</pre>
6) Create new ODB
# Create new ODB
 
<pre>
odbedit -s 1000000
odbedit -s 1000000
 
</pre>
Change the size of the ODB to whatever you want.
Note, you should change the size of the ODB to whatever you need.
 
# reload your original ODB  
7) reload your original ODB  
<pre>
 
load  current_odb.odb
load  current_odb.odb
 
</pre>
8) Rebuild your frontend against new MIDAS; then it should work and you should be able to
# Rebuild your frontend against new MIDAS; then it should work and you should be able to
produce more open records.
produce more open records.

Revision as of 11:12, 25 November 2016

Frequently Asked Questions

There is a related page of Common Installation Problems.

Increasing Number of Hot-links

  1. Use odbedit to save current ODB
odbedit
save current_odb.odb
  1. Stop all the running MIDAS processes, including mlogger and mserver using the web

interface. Then stop mhttpd as well.

  1. Remove your old ODB (we will recreate it after modifying MIDAS, using the backup you just

made).

mv .ODB.SHM .ODB.SHM.20161104
rm /dev/shm/thomas_ODB_SHM
  1. Make the following modifications to midas. In this particular case I have increased the

max number of open records from 256 to 1024. You would need to change the constants if you want to change to other values

diff --git a/include/midas.h b/include/midas.h
index 02b30dd..33be7be 100644
--- a/include/midas.h
+++ b/include/midas.h
@@ -254,7 +254,7 @@ typedef std::vector<std::string> STRING_LIST;
-#define MAX_OPEN_RECORDS       256           /**< number of open DB records   */
+#define MAX_OPEN_RECORDS       1024           /**< number of open DB records   */
diff --git a/src/odb.c b/src/odb.c
index 47ace8f..ac1bef3 100755
--- a/src/odb.c
+++ b/src/odb.c
@@ -699,8 +699,8 @@ static void db_validate_sizes()
-   assert(sizeof(DATABASE_CLIENT) == 2112);
-   assert(sizeof(DATABASE_HEADER) == 135232);
+   assert(sizeof(DATABASE_CLIENT) == 8256);
+   assert(sizeof(DATABASE_HEADER) == 528448);

The calculation is as follows (in case you want a different number of open records): DATABASE_CLIENT = 64 + 8*MAX_OPEN_ERCORDS = 64 + 8*1024 = 8256 DATABASE_HEADER = 64 + 64*DATABASE_CLIENT = 64 + 64*8256 = 528448

  1. Rebuild MIDAS
make clean; make
  1. Create new ODB
odbedit -s 1000000

Note, you should change the size of the ODB to whatever you need.

  1. reload your original ODB
load  current_odb.odb
  1. Rebuild your frontend against new MIDAS; then it should work and you should be able to

produce more open records.