Tuesday, 3 November 2015
Reformatting MPEG-2 DVD to another format
VirtualDubMod is useful for converting MPEG2 TS files to another format.
NServiceBus, DTC and MSMQ
I've spent the last week performance testing our NServiceBus solution extensively.
Our first implementation used MSDTC.
During performance testing of an NServiceBus application using MSMQ transport, we managed to kill MSDTC many times. It would go into a period of hanging for 20 minutes and everything around it; including endpoints not owned by us, stopped working.
We turned off enlistment of the databases called by the handlers by altering the connection strings. This still didn't stop MSDTC from hanging.
Analysis of the stack traces showed that NServiceBus was still engaging MSDTC through the use of TransactionScope around the handler. Although we have switched DisableDistributedTransactions = On, the handlers were still using the local transaction coordinator. We had to set DoNotWrapHandlersExecutionInAT ransactionScope = true.
The different settings are:
https://groups.google.com/forum/#!msg/particularsoftware/SoxeC4RwLlg/Kdt-gjTXYEIJ
Having changed this we were now using TransportTransactions. MSMQ still can handle a Receive and send in a transaction, without using DTC.
MSMQ uses memory-mapped files to store messages (regardless of whether they are express, recoverable, durable). It uses a 4MB file for every message and cleans them up every 6 hours. If you see the memory go very high you can initiate the cleanup by running the following PowerShell:
$MyMSMQApp = new-object –comObject MSMQ.MSMQApplication
$MyMSMQApp.Tidy()
Our first implementation used MSDTC.
During performance testing of an NServiceBus application using MSMQ transport, we managed to kill MSDTC many times. It would go into a period of hanging for 20 minutes and everything around it; including endpoints not owned by us, stopped working.
We turned off enlistment of the databases called by the handlers by altering the connection strings. This still didn't stop MSDTC from hanging.
Analysis of the stack traces showed that NServiceBus was still engaging MSDTC through the use of TransactionScope around the handler. Although we have switched DisableDistributedTransactions = On, the handlers were still using the local transaction coordinator. We had to set DoNotWrapHandlersExecutionInAT
The different settings are:
1) DisableDistributedTransactions = off, DoNotWrapHandlersExecutionInAT ransactionScope = off . The entire handler will be wrapped in an outer transaction scope. Any Bus.Sends will not be immediate and will wait till the outer transaction scope completes. In case of a rollback of the outer transaction scope all the Bus.Sends will be rolled back as well as any database work enlisted in the transaction scope will roll back.
2) DisableDistributedTransactions = on, DoNotWrapHandlersExecutionInAT ransactionScope = off. The entire handler will be wrapped in an outer transaction scope. Any Bus.Sends will be immediate and will not participate in the outer transaction scope. In the case of a rollback of the outer transaction scope the bus.sends will not roll back but any database work in the handler will roll back.
3) DisableDistributedTransactions = off, DoNotWrapHandlersExecutionInAT ransactionScope = on. The handler will not be wrapped in an outer transaction scope. I will explicitly have to start a transaction scope and any bus.sends will not be immediate (they completed upon outer transaction scope complete) and database work done within the manually started one will rollback together. Anything outside of my manually created transaction scope will not rollback.
4) DisableDistributedTransactions = on, DoNotWrapHandlersExecutionInAT ransactionScope = on. The handler will not be wrapped in an outer transaction scope. Each bus.send will be within its own transaction and if a transaction scope is created manually by me those bus sends will not enlist in it will execute immediately and will not roll back if the outer transaction scope rolls back. Any db work done within the manual transaction scope will roll back.
https://groups.google.com/forum/#!msg/particularsoftware/SoxeC4RwLlg/Kdt-gjTXYEIJ
Having changed this we were now using TransportTransactions. MSMQ still can handle a Receive and send in a transaction, without using DTC.
MSMQ uses memory-mapped files to store messages (regardless of whether they are express, recoverable, durable). It uses a 4MB file for every message and cleans them up every 6 hours. If you see the memory go very high you can initiate the cleanup by running the following PowerShell:
$MyMSMQApp = new-object –comObject MSMQ.MSMQApplication
$MyMSMQApp.Tidy()
NServiceBus and MSMQ Transport Transactions
If Distributed Transactions and ambient transactions are turned off, then you are reliant upon MSMQ transactions.
On a transactional queue and with the appropriate code then the Receive operation on the queue will be transactional. This allows NSB to take a message off a queue - preventing other handlers from reading it - process it and if it fails put it back on the queue.
However the MSMQ transaction will only group Receives together in a transaction, or Sends, not a mixture.
So if you have code like this:
a. Begin MSMQ transaction
b. Read Message
c. Process Message
d. Send Result Message onwards
e. Commit Transaction
then this is fine if the point D is the last action in the transaction. If anything fails before it, the MSMQ transaction will fail and the original message at B will be put on the input queue. No output message will have been sent as the processing before it will have failed.
However if you have more than one output message it will yield bad results. Take this scenario:
a. Begin MSMQ transaction
b. Read Message
c. Process some of the message
d. Send Intermediary Message onwards
e. Process some more
f. Send Result Message onwards
g. Commit Transaction
If step E fails then the transaction will be rolled back and the message at B returned to the input queue. However the MSMQ transaction will not roll back step D - the intermediary message will be sent despite the failure of the transaction.
On a transactional queue and with the appropriate code then the Receive operation on the queue will be transactional. This allows NSB to take a message off a queue - preventing other handlers from reading it - process it and if it fails put it back on the queue.
However the MSMQ transaction will only group Receives together in a transaction, or Sends, not a mixture.
So if you have code like this:
a. Begin MSMQ transaction
b. Read Message
c. Process Message
d. Send Result Message onwards
e. Commit Transaction
then this is fine if the point D is the last action in the transaction. If anything fails before it, the MSMQ transaction will fail and the original message at B will be put on the input queue. No output message will have been sent as the processing before it will have failed.
However if you have more than one output message it will yield bad results. Take this scenario:
a. Begin MSMQ transaction
b. Read Message
c. Process some of the message
d. Send Intermediary Message onwards
e. Process some more
f. Send Result Message onwards
g. Commit Transaction
If step E fails then the transaction will be rolled back and the message at B returned to the input queue. However the MSMQ transaction will not roll back step D - the intermediary message will be sent despite the failure of the transaction.
Saturday, 22 August 2015
Default IIS permissions
IIS 6.0 (Windows 2003)
| IIS Worker Process | Unauthenticated access writes files as | |
|---|---|---|
| InetInfo.exe (SYSTEM) | w3wp.exe (NETWORK SERVICE) | Internet Guest Account (machinename\IUSR_machinename) |
Saturday, 11 July 2015
Putting the native32 games on an SD-card for the Xtrons Headrests
I used a 8GB Micro SD Card and formatted it to FAT32.
Go to the native32.com Web site. Click on the Game Lib tab and click on the Batch Download link.
This downloads AllGame070927.rar. Use 7-Zip (an Open Source compression tool) to expand this rar file and copy all the contents to the root of the SD card.
You then have to download the Flash UI (note this doesn't flash your ROM - this means flash as in 'snazzy'!). Click on the Home Tab and click on the Flash UI link. Again, using 7-zip, expand the compressed file and copy fhui.smf to the root of your SD card. This fhui provides a menu for the games. Without this they don't appear to work correctly!
Doing this enables you to play games without having to keep a CD in the unit. You can also put movies in the root too - just make sure they're the correct format.
Go to the native32.com Web site. Click on the Game Lib tab and click on the Batch Download link.
This downloads AllGame070927.rar. Use 7-Zip (an Open Source compression tool) to expand this rar file and copy all the contents to the root of the SD card.
You then have to download the Flash UI (note this doesn't flash your ROM - this means flash as in 'snazzy'!). Click on the Home Tab and click on the Flash UI link. Again, using 7-zip, expand the compressed file and copy fhui.smf to the root of your SD card. This fhui provides a menu for the games. Without this they don't appear to work correctly!
Doing this enables you to play games without having to keep a CD in the unit. You can also put movies in the root too - just make sure they're the correct format.
Video encoding for the Xtrons HD905 headrests
To play movies on the Xtrons HD905 headrests:
Download TEncoder from SourceForge.
Settings : AVI container
- Video : Codec XVID, Bitrate 1024 kbps,
Size 720x480 px with 'Force aspect ratio' to prevent stretched heads
FPS same as Source
- Audio : MP3, max 320 kbps.
AAC audio definitely does not work. AC3 only works on some AVI's.
Download TEncoder from SourceForge.
Settings : AVI container
- Video : Codec XVID, Bitrate 1024 kbps,
Size 720x480 px with 'Force aspect ratio' to prevent stretched heads
FPS same as Source
- Audio : MP3, max 320 kbps.
AAC audio definitely does not work. AC3 only works on some AVI's.
Saturday, 13 June 2015
Single payment, multiple invoices in Kashflow
Sometimes you will invoice a client multiple times and they will make one payment.
I find this very hard to manage in Kashflow so I have recorded the process.
In the bank statement, select the bulk payment and Assign to Invoice, choosing one of the invoices.
Then go to the other invoice(s) and select Apply Credit.
It will allow you to select which Advance Payment (overpayment) you have made.
I find this very hard to manage in Kashflow so I have recorded the process.
In the bank statement, select the bulk payment and Assign to Invoice, choosing one of the invoices.
Then go to the other invoice(s) and select Apply Credit.
It will allow you to select which Advance Payment (overpayment) you have made.
Subscribe to:
Posts (Atom)