website is down,,, (often)
Yeah cuz linux sux I have written software for windows and it never goes down.
My product is used by banks, insurance companies and medical companies that use it in mission critical matters. For some reason I have not been able to figure out why nmcbit goes down. I notice other sites using PHP have the same problem and there is no help on the internet.
I have come close to solving it on the PHP side, it seems that reading from MySQL takes up massive amounts of CPU cycles and if enough people hit the server at the same time it takes it down.
Upgrading from a micro to a large does not help ether it seems like there is an internal issue that I have not found in the documentation yet. But I am still looking for the answer. It's most likely an issue that is in conjunction with some obscure default setting in another product that's causing it.
I considered going to pooled connections but it requires a restructure of my code, and it's not even recommended!!!
I am going to start working on rewriting it for windows once I find it because I am wasting to much time trying to fix this. The only reason I don't stop looking is because with each wrong answer I learn a bit more about Linux and it's not all bad just the fact its interconnected with many separately coded parts that sometimes conflict.
I have learned that the Not Invented Here Syndrome comes from being a Linux developer because if you did not develop it then you can't figure out whats going wrong.
Finally then there are other fires I must put out at my full time job and at NMCBIT. Did you know that for some reason I have a transaction in MySQL that sometimes does not post on inserts and updates? It's when people are getting paid.
INSERT INTO btc_balance (balance_user_id, balance, block_id, shares, pps, ppsamount)
SELECT u.user_id, sum(wh.shares)/lShares * lBlockAmount as balance, lBlock_id, sum(wh.shares) as shares, 0 as pps, 0 as ppsamount
FROM user u, pool_worker pw, workerhistory wh
WHERE u.user_id = pw.user_id AND pw.pool_worker_id = wh.worker_id AND
wh.block_id = lBlock_id and wh.chain_id = aBlockChain AND pw.pps = 0
GROUP BY u.user_id;
INSERT INTO btc_balance (balance_user_id, balance, block_id, shares, pps, ppsamount)
SELECT u.user_id, sum(wh.shares) * lPPSAmount as balance, lBlock_id, sum(wh.shares) as shares, 1 as pps, lPPSAmount as ppsamount
FROM user u, pool_worker pw, workerhistory wh
WHERE u.user_id = pw.user_id AND pw.pool_worker_id = wh.worker_id AND
wh.block_id = lBlock_id and wh.chain_id = aBlockChain AND pw.pps = 1
GROUP BY u.user_id;
UPDATE btc_block SET block_disable = 1 WHERE block_id = lBlock_id;
This code is in a transaction yet for some reason sometimes (not all the time) the update gets posted called but the 2 inserts do not. I have tripled checked the table structures both btc_balance and btc_block are InnoDB that support transactions. I have not seen anything like this with any other Database.
It is jaw dropping. What makes it that much scary is that the same code for name coins has not once failed:
INSERT INTO nmc_balance (balance_user_id, balance, block_id, shares, pps, ppsamount)
SELECT u.user_id, sum(wh.shares)/lShares * lBlockAmount as balance, lBlock_id, sum(wh.shares) as shares, 0 as pps, 0 as ppsamount
FROM user u, pool_worker pw, workerhistory wh
WHERE u.user_id = pw.user_id AND pw.pool_worker_id = wh.worker_id AND
wh.block_id = lBlock_id and wh.chain_id = aBlockChain AND pw.pps = 0
GROUP BY u.user_id;
INSERT INTO nmc_balance (balance_user_id, balance, block_id, shares, pps, ppsamount)
SELECT u.user_id, sum(wh.shares) * lPPSAmount as balance, lBlock_id, sum(wh.shares) as shares, 1 as pps, lPPSAmount as ppsamount
FROM user u, pool_worker pw, workerhistory wh
WHERE u.user_id = pw.user_id AND pw.pool_worker_id = wh.worker_id AND
wh.block_id = lBlock_id and wh.chain_id = aBlockChain AND pw.pps = 1
GROUP BY u.user_id;
UPDATE nmc_block SET block_disable = 1 WHERE block_id = lBlock_id;
Then there is the timing issue that's my fault as I want instant feed back when a block is found but the counts are not ready because all shares are not posted. I have to restructure to fix that problem.
Anyhow I will find a solution for all of this in eventually and have new problems
Davinci